Fix voice handling of new lines

This commit is contained in:
Joey Hines 2026-05-03 19:56:06 -06:00
parent fa4863bfb3
commit dbae599c43
Signed by: joeyahines
GPG Key ID: E99D8FB14855100E

View File

@ -142,8 +142,13 @@ pub async fn speak(
let dict = get_voice_dictionary(&voice_path).await.unwrap(); let dict = get_voice_dictionary(&voice_path).await.unwrap();
let mut sentence = Vec::new(); let mut sentence = Vec::new();
for word in phrase.split(' ') { for word in phrase.split(&[' ', '\n']) {
let word = word.to_lowercase(); let word = word.to_lowercase();
if word.is_empty() || word == " " {
continue
}
let mut add_period = false; let mut add_period = false;
let mut add_comma = false; let mut add_comma = false;
let word = if word.ends_with(',') { let word = if word.ends_with(',') {