Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eabd537
feat(huddle): cut voice-turn time-to-first-audio via env-gated latenc…
Aug 12, 2026
49ec563
feat(huddle): voice-mode guidelines — instant spoken ack + write-for-…
Aug 12, 2026
a3e6407
Merge origin/main into eva/huddle-first-audio-latency
Aug 12, 2026
88d80af
fix(buzz-voice): key voice caches by sample content, not buffer address
Aug 12, 2026
7445169
fix(huddle): round flush-ms override up to whole VAD frames; assert w…
Aug 12, 2026
a978b6f
refactor(huddle): restore desktop file-size ratchet by extracting gro…
Aug 12, 2026
18fab2e
fix(huddle): remove the flush-window override; never silence-flush wh…
Aug 12, 2026
017d35f
Merge origin/main into eva/huddle-first-audio-latency
Aug 12, 2026
f13bcbf
Merge origin/main into eva/huddle-first-audio-latency
Aug 12, 2026
12184e6
fix(huddle): raise agent speech limit
Aug 12, 2026
4979d59
fix(huddle): default push-to-talk to a muted microphone
Aug 12, 2026
997f283
fix(huddle): load voice instructions into system prompt (#5707)
tlongwell-block Aug 12, 2026
c89d413
Merge origin/main into eva/huddle-first-audio-latency
Aug 12, 2026
ec2af79
fix(huddle): keep transcribing while agent TTS plays
Aug 13, 2026
01e57a7
Merge origin/main into eva/huddle-first-audio-latency
Aug 13, 2026
a37c1d1
feat(huddle): add current-channel toggle shortcut
Aug 13, 2026
f9451f1
Merge branch 'main' into eva/huddle-first-audio-latency
Aug 13, 2026
b4f4774
fix(desktop): scope capture-phase keydown to the huddle shortcut
Aug 13, 2026
fbf773a
feat(voice): pack natural TTS sentences without fixed silence (#5766)
tlongwell-block Aug 13, 2026
e113824
Merge main into eva/huddle-first-audio-latency to pick up #5799 e2e f…
Aug 13, 2026
3b80679
Merge main into eva/huddle-first-audio-latency, resolving AppHuddleSh…
Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion crates/buzz-voice/src/pocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ pub const VOICE_FILE_EXT: &str = "wav";

const TTS_NUM_THREADS: usize = 1;

/// EXPERIMENTAL (latency): override ONNX intra-op threads for the Pocket
/// sessions via `BUZZ_TTS_THREADS`. Default preserves production's 1.
fn tts_num_threads() -> usize {
std::env::var("BUZZ_TTS_THREADS")
.ok()
.and_then(|v| v.parse::<usize>().ok())
.filter(|&n| n >= 1)
.unwrap_or(TTS_NUM_THREADS)
}

/// Loaded reference voice samples and their original sample rate.
#[derive(Debug, Clone)]
pub struct VoiceStyle {
Expand Down Expand Up @@ -83,7 +93,7 @@ pub fn load_text_to_speech(model_dir: &str) -> Result<PocketTts, String> {
}
}
Ok(PocketTts {
inner: Mutex::new(AprilPocketTts::load(&dir, TTS_NUM_THREADS)?),
inner: Mutex::new(AprilPocketTts::load(&dir, tts_num_threads())?),
})
}

Expand Down Expand Up @@ -127,6 +137,36 @@ impl PocketTts {
}
Ok(samples)
}

/// EXPERIMENTAL (latency): streaming synthesis. Invokes `on_audio` with
/// PCM deltas as soon as roughly `emit_frames` Flow LM frames (80 ms of
/// audio each) have been generated and decoded. Concatenated deltas equal
/// one `synth_chunk` result. The callback runs on the caller thread and
/// returns `false` to cancel; the function then returns Ok(false).
pub fn synth_chunk_streaming(
&self,
text: &str,
style: &VoiceStyle,
emit_frames: usize,
on_audio: &mut dyn FnMut(Vec<f32>) -> bool,
) -> Result<bool, String> {
let Some(prepared) = prepare_april_prompt(text) else {
return Ok(true);
};
let mut engine = self
.inner
.lock()
.map_err(|_| "Pocket TTS engine lock poisoned".to_string())?;
let chunks = engine.split_prompt(&prepared)?;
for chunk in chunks {
let prepared = prepare_april_prompt(&chunk)
.ok_or_else(|| "Pocket TTS prompt chunk became empty".to_string())?;
if !engine.synth_chunk_streaming(&prepared, style, emit_frames, on_audio)? {
return Ok(false);
}
}
Ok(true)
}
}

#[cfg(test)]
Expand Down
Loading
Loading