mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-23 03:19:38 +00:00
Don't double-speak previous item when not flushing queue.
This commit is contained in:
parent
9c98026978
commit
289a35dc83
|
@ -156,6 +156,12 @@ impl Backend for WinRT {
|
|||
let content_type = stream.content_type()?;
|
||||
let source = MediaSource::create_from_stream(stream, content_type)?;
|
||||
let item = MediaPlaybackItem::create(source)?;
|
||||
let item_index = self.playback_list.current_item_index()?;
|
||||
let item_count = self.playback_list.items()?.size()?;
|
||||
let state = self.player.playback_session()?.playback_state()?;
|
||||
if state == MediaPlaybackState::Paused && item_index != 0 {
|
||||
self.playback_list.items()?.clear()?;
|
||||
}
|
||||
self.playback_list.items()?.append(&item)?;
|
||||
if !self.is_speaking()? {
|
||||
self.player.play()?;
|
||||
|
|
Loading…
Reference in New Issue
Block a user