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
1 changed files with 2 additions and 4 deletions

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())?;