fix(gateway): use OGG for Telegram auto TTS
This commit is contained in:
+4
-3
@@ -12422,11 +12422,12 @@ class GatewayRunner:
|
||||
if not tts_text:
|
||||
return
|
||||
|
||||
# Use .mp3 extension so edge-tts conversion to opus works correctly.
|
||||
# The TTS tool may convert to .ogg — use file_path from result.
|
||||
# Telegram's adapter only sends native voice bubbles for OGG/Opus.
|
||||
# Other platforms keep the existing MP3 default.
|
||||
audio_ext = "ogg" if event.source.platform == Platform.TELEGRAM else "mp3"
|
||||
audio_path = os.path.join(
|
||||
tempfile.gettempdir(), "hermes_voice",
|
||||
f"tts_reply_{_uuid.uuid4().hex[:12]}.mp3",
|
||||
f"tts_reply_{_uuid.uuid4().hex[:12]}.{audio_ext}",
|
||||
)
|
||||
os.makedirs(os.path.dirname(audio_path), exist_ok=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user