From 8e868894cbcaf421c263f3555af4d29bef653420 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 5 Sep 2026 19:35:21 +0200 Subject: feat: piper now not a subprocess, cache system for TTS --- src/commands/ai.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/commands/ai.rs') diff --git a/src/commands/ai.rs b/src/commands/ai.rs index 61fb471..5dd98cb 100644 --- a/src/commands/ai.rs +++ b/src/commands/ai.rs @@ -30,15 +30,14 @@ pub async fn senator( }) .ok_or_else(lang::err_not_in_voice)?; - let (audio_data, _) = - crate::tts::synthesize(&ctx.data().config, &ctx.data().http_client, &response).await?; + let audio_data = ctx.data().tts.synthesize(&response).await?; let call = ctx .data() .voice_manager .connect(guild_id, channel_id) .await?; - let input = crate::voice::decode_audio(&audio_data)?; + let input = crate::tts::pcm_bytes_to_input(audio_data); let mut call_lock = call.lock().await; if call_lock.current_channel().is_some() { call_lock.play_input(input); -- cgit v1.2.3