diff options
| author | salmonik <salmonik@tuta.io> | 2026-09-05 19:35:21 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-09-05 19:35:21 +0200 |
| commit | 8e868894cbcaf421c263f3555af4d29bef653420 (patch) | |
| tree | a6b6f1de5caeef59367e52a8b7cfa6c2cd9f201d /src/main.rs | |
| parent | remove ` from TTS and make events use lang.rs (diff) | |
| download | senator-sperma-8e868894cbcaf421c263f3555af4d29bef653420.tar.gz senator-sperma-8e868894cbcaf421c263f3555af4d29bef653420.zip | |
feat: piper now not a subprocess, cache system for TTS
Diffstat (limited to '')
| -rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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 { | |||
| 50 | pub ac_search_cache: AcSearchCache, | 50 | pub ac_search_cache: AcSearchCache, |
| 51 | /// Active music track per guild (only one music source at a time). | 51 | /// Active music track per guild (only one music source at a time). |
| 52 | pub music_tracks: Arc<tokio::sync::Mutex<HashMap<u64, songbird::tracks::TrackHandle>>>, | 52 | pub music_tracks: Arc<tokio::sync::Mutex<HashMap<u64, songbird::tracks::TrackHandle>>>, |
| 53 | /// TTS engine: piper model + audio cache. | ||
| 54 | pub tts: Arc<tts::TtsState>, | ||
| 53 | } | 55 | } |
| 54 | 56 | ||
| 55 | impl Data { | 57 | impl Data { |
| @@ -187,7 +189,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||
| 187 | 189 | ||
| 188 | let music_tracks: Arc<tokio::sync::Mutex<HashMap<u64, songbird::tracks::TrackHandle>>> = Arc::new(tokio::sync::Mutex::new(HashMap::new())); | 190 | let music_tracks: Arc<tokio::sync::Mutex<HashMap<u64, songbird::tracks::TrackHandle>>> = Arc::new(tokio::sync::Mutex::new(HashMap::new())); |
| 189 | 191 | ||
| 192 | let tts = Arc::new(tts::TtsState::new(config.piper_model_path())); | ||
| 193 | |||
| 190 | let data = Data { | 194 | let data = Data { |
| 195 | tts, | ||
| 191 | config, | 196 | config, |
| 192 | db_pool, | 197 | db_pool, |
| 193 | voice_manager: vm, | 198 | voice_manager: vm, |
