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/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 7f57421..5ab33ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,8 @@ pub struct Data { pub ac_search_cache: AcSearchCache, /// Active music track per guild (only one music source at a time). pub music_tracks: Arc>>, + /// TTS engine: piper model + audio cache. + pub tts: Arc, } impl Data { @@ -187,7 +189,10 @@ async fn main() -> Result<(), Box> { let music_tracks: Arc>> = Arc::new(tokio::sync::Mutex::new(HashMap::new())); + let tts = Arc::new(tts::TtsState::new(config.piper_model_path())); + let data = Data { + tts, config, db_pool, voice_manager: vm, -- cgit v1.2.3