auto pausing can't be known until neighboring strings are computed we create a unique string in this case and compute the real value later
(&self, command: &TTSCommandRule, prefs: &PreferenceManager, is_start_tag: bool)
| 478 | // auto pausing can't be known until neighboring strings are computed |
| 479 | // we create a unique string in this case and compute the real value later |
| 480 | fn get_string_none(&self, command: &TTSCommandRule, prefs: &PreferenceManager, is_start_tag: bool) -> String { |
| 481 | // they only thing to do is handle "pause" with some punctuation hacks along with 'spell' |
| 482 | if is_start_tag { |
| 483 | if command.command == TTSCommand::Pause { |
| 484 | let amount = command.value.get_num(); |
| 485 | // only ',' and ';' are used as '.' didn't seem to reliably generate pauses in tests |
| 486 | return crate::speech::CONCAT_INDICATOR.to_string() + ( |
| 487 | if amount == PAUSE_AUTO { |
| 488 | PAUSE_AUTO_STR |
| 489 | } else { |
| 490 | let amount = amount * TTS::get_pause_multiplier(prefs); |
| 491 | if amount <= MIN_PAUSE { |
| 492 | "" |
| 493 | } else if amount <= 250.0 { |
| 494 | "," |
| 495 | } else { |
| 496 | ";" |
| 497 | } |
| 498 | } |
| 499 | ); |
| 500 | } else if command.command == TTSCommand::Spell { |
| 501 | // debug!("spell rule: {}", command.value.get_string()); |
| 502 | return command.value.get_string().to_string(); |
| 503 | } else if let TTSCommandValue::Pronounce(p) = &command.value { |
| 504 | return crate::speech::CONCAT_INDICATOR.to_string() + &p.text; |
| 505 | } |
| 506 | }; |
| 507 | return "".to_string(); |
| 508 | } |
| 509 | |
| 510 | fn get_string_sapi5(&self, command: &TTSCommandRule, prefs: &PreferenceManager, is_start_tag: bool) -> String { |
| 511 | return match &command.command { |
no test coverage detected