fix(gateway): use OGG/Opus for Matrix voice replies - #58716
Closed
liuhao1024 wants to merge 1 commit into
Closed
Conversation
Matrix MSC3245 voice messages require Opus audio format, but both the _send_voice_reply path in gateway/run.py and the want_opus check in tools/tts_tool.py only applied Opus conversion for Telegram. - gateway/run.py: add Platform.MATRIX to the voice_platforms tuple so _send_voice_reply generates .ogg files for Matrix - tools/tts_tool.py: add "matrix" to the want_opus condition so the TTS tool triggers ffmpeg Opus conversion for Matrix sessions - tests/tools/test_tts_opus_routing.py: add regression test verifying Edge TTS converts to Opus when HERMES_SESSION_PLATFORM=matrix Fixes NousResearch#58715
Collaborator
Duplicate of #14900, an earlier open PR fixing the same bug (#14841) via the same mechanism: adding |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Matrix MSC3245 voice messages require Opus audio format, but both the
_send_voice_replypath ingateway/run.pyand thewant_opuscheck intools/tts_tool.pyonly triggered Opus conversion for Telegram. Matrix voice replies were sent as MP3/WAV, which Element X silently refuses to play in the voice bubble.Related Issue
Fixes #58715
Type of Change
Changes Made
gateway/run.py: AddPlatform.MATRIXto the_voice_platformstuple so_send_voice_replygenerates.oggfiles for Matrix sessionstools/tts_tool.py: Add"matrix"to thewant_opuscondition so the TTS tool triggers ffmpeg Opus conversion for Matrix platform sessionstests/tools/test_tts_opus_routing.py: Add regression test verifying Edge TTS converts to Opus whenHERMES_SESSION_PLATFORM=matrixHow to Test
/voice ttsto enable voice repliespytest tests/tools/test_tts_opus_routing.py -v— all 3 tests should pass, including the newtest_edge_matrix_converts_to_opus_voiceChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/tools/test_tts_opus_routing.py -vand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A