Fix voice handling of new lines
This commit is contained in:
parent
fa4863bfb3
commit
dbae599c43
@ -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(',') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user