1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-11-17 12:39:36 +00:00

For single-character text, set punctuation to all so the text is spoken.

This commit is contained in:
Nolan Darilek 2019-09-30 10:36:51 -05:00
parent 36745f9850
commit 7488dcbe3a

View File

@ -43,7 +43,14 @@ impl Backend for SpeechDispatcher {
if interrupt {
self.stop()?;
}
let single_char = text.to_string().capacity() == 1;
if single_char {
self.0.set_punctuation(Punctuation::All);
}
self.0.say(Priority::Important, text);
if single_char {
self.0.set_punctuation(Punctuation::None);
}
Ok(())
}