tts: start splitting out tts into its own module, to grow later with more features

This commit is contained in:
2026-06-03 19:21:00 +02:00
parent f1e6684d9c
commit 1e50c7222f
2 changed files with 19 additions and 12 deletions
+16
View File
@@ -0,0 +1,16 @@
use std::process::Command;
pub async fn start_tts() -> tokio::sync::mpsc::Sender<String> {
let (tts_request_sender, mut tts_request_receiver) = tokio::sync::mpsc::channel(3);
// Set up the TTS task
tokio::spawn(async move {
while let Some(text) = tts_request_receiver.recv().await {
// TODO: We should also have espeak pipe out to stdout, then we can apply some audio effects and write to our own jack port.
Command::new("espeak-ng").arg("-v").arg("en-us+f3").arg(text).spawn().unwrap().wait().unwrap();
}
});
tts_request_sender
}