Send text as voice messages to any chat channel.
edge-tts — Microsoft Edge TTS (pip install edge-tts)ffmpeg / ffprobe — audio conversion and duration detectionzh-CN-XiaoxiaoNeuralen-US-JennyNeuralUse scripts/gen_voice.sh to convert text to an ogg/opus file:
scripts/gen_voice.sh "你好" /tmp/voice.ogg
scripts/gen_voice.sh "Hello" /tmp/voice.ogg en-US-JennyNeural
Arguments:
zh-CN-XiaoxiaoNeural.Use the message tool directly:
action=send, asVoice=true, filePath=/tmp/voice.ogg
This works for most channels. Telegram confirmed working.
⚠️ Feishu does NOT support asVoice=true via the message tool. You must use the dedicated script.
Use scripts/send_feishu_voice.sh:
scripts/send_feishu_voice.sh /tmp/voice.ogg <receive_id> <tenant_access_token> [receive_id_type]
receive_id_type: open_id (default), chat_id, user_id, union_id, emailtenant_access_token, use the Feishu tenant token API with your app credentials.Discord voice messages require a waveform and special flags.
scripts/gen_voice.shpython3 scripts/gen_waveform.py /tmp/voice.ogg{"duration_secs": 4.2, "waveform": "base64..."}flags: 8192 (IS_VOICE_MESSAGE) and the waveform/duration in attachments metadata.If asVoice=true does not produce a voice bubble on a channel:
共 1 个版本