From d13fe996b109ef96b8f715a6f8604fc2dfca1916 Mon Sep 17 00:00:00 2001 From: John Tennant Date: Wed, 19 Aug 2026 14:02:54 -0400 Subject: [PATCH] fix(huddle): accept false for streaming TTS rollback Signed-off-by: John Tennant --- desktop/src-tauri/src/huddle/tts_streaming.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop/src-tauri/src/huddle/tts_streaming.rs b/desktop/src-tauri/src/huddle/tts_streaming.rs index 6f4e641c4f..9b6d0a45ba 100644 --- a/desktop/src-tauri/src/huddle/tts_streaming.rs +++ b/desktop/src-tauri/src/huddle/tts_streaming.rs @@ -1,8 +1,8 @@ //! Streaming synthesis path for the TTS worker. //! //! PCM deltas stream out of Pocket as they are generated instead of waiting -//! for the full first-chunk synthesis. `BUZZ_TTS_STREAMING=0` restores the -//! batch path as an operational fallback. +//! for the full first-chunk synthesis. `BUZZ_TTS_STREAMING=0` or `false` +//! restores the batch path as an operational fallback. //! `BUZZ_TTS_EMIT_FRAMES` tunes the delta size in Flow LM frames (80 ms of //! audio each). Default 12 = the Mimi decoder's native chunk, which keeps //! streamed audio bit-identical to the batch path; smaller deltas are faster @@ -14,7 +14,8 @@ use super::*; use crate::huddle::pocket::{PocketTts, VoiceStyle}; /// Read the streaming env overrides once per worker. Streaming defaults to the -/// Mimi decoder's native 12-frame chunk; `BUZZ_TTS_STREAMING=0` opts out. +/// Mimi decoder's native 12-frame chunk; `BUZZ_TTS_STREAMING=0` or `false` +/// opts out. pub(super) fn streaming_emit_frames() -> Option { resolve_streaming_emit_frames( std::env::var("BUZZ_TTS_STREAMING").ok().as_deref(), @@ -26,7 +27,8 @@ fn resolve_streaming_emit_frames( enabled: Option<&str>, emit_frames: Option<&str>, ) -> Option { - (enabled != Some("0")).then(|| emit_frames.and_then(|v| v.parse().ok()).unwrap_or(12)) + (!matches!(enabled, Some("0" | "false"))) + .then(|| emit_frames.and_then(|v| v.parse().ok()).unwrap_or(12)) } /// Playback context threaded through one streamed chunk. @@ -142,6 +144,7 @@ mod tests { #[test] fn streaming_can_be_disabled_for_operational_rollback() { assert_eq!(resolve_streaming_emit_frames(Some("0"), None), None); + assert_eq!(resolve_streaming_emit_frames(Some("false"), None), None); } #[test]