fix(tts): gate Edge TTS OGG conversion on Telegram delivery (#26404) - #26748
Closed
Tranquil-Flow wants to merge 1 commit into
Closed
fix(tts): gate Edge TTS OGG conversion on Telegram delivery (#26404)#26748Tranquil-Flow wants to merge 1 commit into
Tranquil-Flow wants to merge 1 commit into
Conversation
Edge TTS writes MP3 natively, but the post-generation OGG/Opus conversion fired for every platform — including CLI on macOS, where afplay can't reliably play OGG/Opus and the returned file_path no longer matched the caller-supplied .mp3 path. Gate the conversion block on want_opus (already computed from HERMES_SESSION_PLATFORM == 'telegram') so the OGG/Opus re-encode only runs when it's actually needed for Telegram voice bubbles. Non-Telegram callers keep the native MP3 (or WAV for NeuTTS/KittenTTS) output. Fixes NousResearch#26404
Collaborator
Contributor
Author
|
Closing as graceful supersession by #26406 (@aqilaziz, opened 2026-05-15, ~1 day earlier). Both PRs gate the OGG conversion on Telegram platform detection so non-Telegram sessions retain native MP3/WAV. @aqilaziz's PR is more comprehensive (+108/-12 vs ours +92/-1) — additionally preserves native Edge MP3 for CLI/local paths with explicit |
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?
Gates the Edge TTS post-generation OGG/Opus conversion on
want_opus(already computed fromHERMES_SESSION_PLATFORM == 'telegram') so non-Telegram callers keep the native MP3 output. Before this fix, every Edge TTS call ran the OGG re-encode unconditionally, which broke CLI playback on macOS (afplay can't reliably play OGG/Opus) and returned afile_paththat no longer matched the caller-supplied.mp3path.Related Issue
Fixes #26404
Type of Change
How was this tested?
Added
tests/tools/test_tts_edge_no_ogg_cli.pycovering:HERMES_SESSION_PLATFORM) → native.mp3preservedRan the new test file plus the existing tts_tool suite — all pass.
Scope notes
want_opusflag is the existing platform-aware gate already used for Telegram voice bubble delivery — this PR just routes the conversion block through it.Checklist