voice no longer hard-coded, bogeydope ordering fix, tripwire ignoring on-ground units
This commit is contained in:
@@ -162,7 +162,7 @@ fn listen_srs(
|
||||
|
||||
let frequency = radio.frequency;
|
||||
let id = *id;
|
||||
let voice = radio.voice;
|
||||
let voice = radio.voice.clone();
|
||||
let stt_url = stt_url.as_str().to_string();
|
||||
radio.handle = Some(tokio.0.spawn(async move {
|
||||
loop {
|
||||
@@ -520,19 +520,18 @@ fn handle_voice_command(
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
pub enum Voice {
|
||||
#[default]
|
||||
David,
|
||||
Zira,
|
||||
#[derive(Default, Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Voice(String);
|
||||
|
||||
impl Voice {
|
||||
pub fn new(voice: impl Into<String>) -> Self {
|
||||
Self(voice.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Voice {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::David => write!(f, "David"),
|
||||
Self::Zira => write!(f, "Zira"),
|
||||
}
|
||||
write!(f, "{}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user