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:
parent
36745f9850
commit
7488dcbe3a
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user