Commit Graph

15 Commits

Author SHA1 Message Date
teknium1 3a179fe524 refactor(gateway): every Ogg/Opus voice transcode routes through base.transcode_to_ogg_opus
Matrix, WhatsApp Cloud and the TTS tool each ran their own ffmpeg argv for the same
speech-tuned libopus encode; they predate the shared helper and never migrated, so the
codec flags, timeout handling and error reporting drifted (matrix 48k/30s, whatsapp_cloud
async subprocess with no timeout and no `-ac 1`, tts an in-place sidecar repair).

`transcode_to_ogg_opus` gains `timeout=` and `output_path=` (sibling-file and in-place
writes go through a `.tmp.ogg` sidecar so a failed encode never truncates the source).
Deleted: matrix `_matrix_transcode_voice_to_ogg`, tts `_ffmpeg_transcode_to_opus`;
whatsapp_cloud `_convert_to_opus` keeps only its warn-once ffmpeg install hint and calls
the helper via `asyncio.to_thread`. Matrix and tts keep their 48k bitrate.

Behavior change: whatsapp_cloud transcodes now use mono (`-ac 1`), `-compression_level 10`
and a 60s timeout like every other voice bubble; a failed encode logs at WARNING for all
three sites (matrix previously DEBUG).
2026-09-13 05:32:38 -07:00
Teknium 7664005a5d refactor(tools): pack tts constant tables, writelines for elevenlabs, lease release result literal 2026-09-03 01:23:19 -07:00
Teknium 01262a79eb refactor(tools): fold sniff/read into one with-block, lifecycle timing locals 2026-09-03 01:21:30 -07:00
Teknium 5752c2dd68 refactor(tools): iter-sentinel drain, fold ogg repair guard, speaker init tuple, PEP8 blank fix 2026-09-03 01:17:43 -07:00
Teknium f0cac15ad1 refactor(tools): collapse tts delivery profile/packing locals, speaker aligner tail, wrap long import 2026-09-03 01:12:56 -07:00
Teknium 636bf247e8 refactor(tools): wrap over-long tts call lines (AST-neutral) 2026-09-03 01:09:56 -07:00
Teknium df4547570a refactor(tools): squeeze in-body and banner blank lines in tts modules 2026-09-03 01:09:11 -07:00
Teknium 6df5cbb6d1 refactor(tools): collapse tts_tool/delivery/local/lifecycle/plugins guards and single-use locals; tighten docstrings 2026-09-03 01:00:06 -07:00
Teknium 282d714837 refactor(tools): AST-neutral layout compaction of tts modules (hug brackets, join closers) 2026-09-03 00:54:51 -07:00
Teknium 45fb404019 refactor(tools): share tts _origin/_section/_remove_quietly via delivery module; fold gemini json body parsing, media tag, stream reinit 2026-09-03 00:47:54 -07:00
Teknium 70d290fa46 refactor(tools): unify tts text packers, drop dead MAX_TEXT_LENGTH alias, compact docstrings 2026-09-02 23:30:19 -07:00
Teknium 35f68c5b77 refactor(tools): pack tts re-export import lists, one-line section banners 2026-09-02 23:16:29 -07:00
Teknium e2793ca72b refactor(tools): unify tts delivery ffmpeg runner and quiet-remove helper 2026-09-02 22:34:54 -07:00
Teknium caf37e23d4 refactor(tts): importer factory, requirements table, caps to delivery, legacy strip to text_normalize, single-chunk dedupe 2026-09-02 16:44:13 -07:00
Teknium 2ef1e8e4e0 refactor(tools/voice): extract tts delivery + wake_word engines; dedupe transcription/voice_mode helpers; compact tts providers 2026-09-02 14:45:15 -07:00