1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-10-09 21:09:38 +00:00

Remove a conditional that blocked playback in some circumstances on the WinRT backend.

This commit is contained in:
Nolan Darilek 2021-05-20 17:07:55 -05:00
parent ca7789f157
commit c4038149a8

View File

@ -11,7 +11,7 @@ use bindings::Windows::{
Foundation::TypedEventHandler,
Media::{
Core::MediaSource,
Playback::{MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory},
Playback::{MediaPlayer, MediaPlayerAudioCategory},
SpeechSynthesis::SpeechSynthesizer,
},
};
@ -181,9 +181,7 @@ impl Backend for WinRt {
utterances.push_back(utterance);
}
}
if no_utterances
&& self.player.PlaybackSession()?.PlaybackState()? != MediaPlaybackState::Playing
{
if no_utterances {
self.synth.Options()?.SetSpeakingRate(self.rate.into())?;
self.synth.Options()?.SetAudioPitch(self.pitch.into())?;
self.synth.Options()?.SetAudioVolume(self.volume.into())?;