2023-06-11 19:17:50 +05:00
|
|
|
use crate::config;
|
2025-12-11 23:43:50 +05:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-06-11 19:17:50 +05:00
|
|
|
|
|
|
|
|
use crate::config::structs::SpeechToTextEngine;
|
2025-12-11 23:43:50 +05:00
|
|
|
use crate::config::structs::WakeWordEngine;
|
2023-06-11 19:17:50 +05:00
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
|
pub struct Settings {
|
|
|
|
|
pub microphone: i32,
|
|
|
|
|
pub voice: String,
|
|
|
|
|
|
|
|
|
|
pub wake_word_engine: WakeWordEngine,
|
|
|
|
|
pub speech_to_text_engine: SpeechToTextEngine,
|
|
|
|
|
|
2025-12-11 23:43:50 +05:00
|
|
|
pub api_keys: ApiKeys,
|
2023-06-11 19:17:50 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for Settings {
|
|
|
|
|
fn default() -> Settings {
|
|
|
|
|
Settings {
|
|
|
|
|
microphone: -1,
|
|
|
|
|
voice: String::from(""),
|
|
|
|
|
|
|
|
|
|
wake_word_engine: config::DEFAULT_WAKE_WORD_ENGINE,
|
|
|
|
|
speech_to_text_engine: config::DEFAULT_SPEECH_TO_TEXT_ENGINE,
|
|
|
|
|
|
|
|
|
|
api_keys: ApiKeys {
|
|
|
|
|
picovoice: String::from(""),
|
2025-12-11 23:43:50 +05:00
|
|
|
openai: String::from(""),
|
|
|
|
|
},
|
2023-06-11 19:17:50 +05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
|
|
|
pub struct ApiKeys {
|
|
|
|
|
pub picovoice: String,
|
2025-12-11 23:43:50 +05:00
|
|
|
pub openai: String,
|
|
|
|
|
}
|