Add sample config and the option to speak repeated lines at a faster rate
This commit is contained in:
+12
-3
@@ -23,7 +23,7 @@ use std::{
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
mpsc,
|
||||
},
|
||||
time::Duration,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use tokio::sync::mpsc as tokio_mpsc;
|
||||
use tui::{App, UiAction};
|
||||
@@ -164,7 +164,7 @@ fn process_worker_event(
|
||||
} else {
|
||||
let key = events::speaker_key(speaker);
|
||||
if let Some(voice) = app.speakers.resolve_voice(
|
||||
key,
|
||||
key.clone(),
|
||||
speaker.clone(),
|
||||
&app.voices,
|
||||
app.current_zone.clone(),
|
||||
@@ -174,6 +174,9 @@ fn process_worker_event(
|
||||
.try_send(SynthesisJob {
|
||||
text: text.clone(),
|
||||
voice,
|
||||
speed: 1.0,
|
||||
repeat_key: format!("{key}\u{1f}{text}"),
|
||||
observed_at: Instant::now(),
|
||||
})
|
||||
.is_err()
|
||||
{
|
||||
@@ -197,7 +200,13 @@ fn enqueue_random_event(
|
||||
use rand::prelude::IndexedRandom;
|
||||
if let Some(voice) = app.voices.choose(&mut rand::rng()).cloned() {
|
||||
synthesis_sender
|
||||
.try_send(SynthesisJob { text, voice })
|
||||
.try_send(SynthesisJob {
|
||||
repeat_key: format!("event:\u{1f}{text}"),
|
||||
text,
|
||||
voice,
|
||||
speed: 1.0,
|
||||
observed_at: Instant::now(),
|
||||
})
|
||||
.context("speech queue is busy")?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user