mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-22 23:49:38 +00:00
Fix issue where is_speaking always returns true under WinRT, and bump version.
This commit is contained in:
parent
efdb274eb4
commit
565aa6d654
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tts"
|
name = "tts"
|
||||||
version = "0.10.2"
|
version = "0.10.3"
|
||||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||||
repository = "https://github.com/ndarilek/tts-rs"
|
repository = "https://github.com/ndarilek/tts-rs"
|
||||||
description = "High-level Text-To-Speech (TTS) interface"
|
description = "High-level Text-To-Speech (TTS) interface"
|
||||||
|
|
|
@ -27,6 +27,10 @@ fn main() -> Result<(), Error> {
|
||||||
println!("Stopped speaking {:?}", utterance)
|
println!("Stopped speaking {:?}", utterance)
|
||||||
})))?;
|
})))?;
|
||||||
}
|
}
|
||||||
|
let Features { is_speaking, .. } = tts.supported_features();
|
||||||
|
if is_speaking {
|
||||||
|
println!("Are we speaking? {}", tts.is_speaking()?);
|
||||||
|
}
|
||||||
tts.speak("Hello, world.", false)?;
|
tts.speak("Hello, world.", false)?;
|
||||||
let Features { rate, .. } = tts.supported_features();
|
let Features { rate, .. } = tts.supported_features();
|
||||||
if rate {
|
if rate {
|
||||||
|
|
|
@ -269,7 +269,7 @@ impl Backend for WinRT {
|
||||||
|
|
||||||
fn is_speaking(&self) -> std::result::Result<bool, Error> {
|
fn is_speaking(&self) -> std::result::Result<bool, Error> {
|
||||||
let state = self.player.playback_session()?.playback_state()?;
|
let state = self.player.playback_session()?.playback_state()?;
|
||||||
let playing = state == MediaPlaybackState::Opening || state == MediaPlaybackState::Playing;
|
let playing = state == MediaPlaybackState::Playing;
|
||||||
Ok(playing)
|
Ok(playing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user