tts: start splitting out tts into its own module, to grow later with more features
This commit is contained in:
+16
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user