found bug in random srs
This commit is contained in:
1 parent
01ba0567f5
commit
c5e91b844c
3 files changed
+17
-29
No files matched your search
+9
-8
@@ -9,8 +9,8 @@ use chrono::Local;
|
||||
use iced::alignment::Horizontal::Center;
|
||||
use iced::keyboard::key::Physical::Code;
|
||||
use iced::widget::text::Style;
|
||||
use iced::widget::{Column, button, column, container, row, rule, space, text, tooltip};
|
||||
use iced::{Element, Fill, Task, Theme, alignment, keyboard};
|
||||
use iced::widget::{button, column, container, row, rule, space, text, tooltip, Column};
|
||||
use iced::{alignment, keyboard, Element, Fill, Task, Theme};
|
||||
use parking_lot::Mutex;
|
||||
use rodio::MixerDeviceSink;
|
||||
use std::collections::HashSet;
|
||||
@@ -317,10 +317,11 @@ pub enum RepetitionMessage {
|
||||
}
|
||||
|
||||
async fn play_sound(sink: Arc<MixerDeviceSink>, text: String) {
|
||||
let data = get_voice(text.as_str()).await;
|
||||
spawn_blocking(move || {
|
||||
rodio::play(sink.mixer(), data).unwrap().sleep_until_end();
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
if let Ok(data) = get_voice(text.as_str()).await {
|
||||
spawn_blocking(move || {
|
||||
rodio::play(sink.mixer(), data).unwrap().sleep_until_end();
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user