From 0d1fdab3a10b30d83da50b7f20acc18b7a350a22 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 9 Sep 2026 14:36:50 +0200 Subject: wire recording into voice manager, config, events, /record command --- src/config.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 3b92dd8..95c1a18 100644 --- a/src/config.rs +++ b/src/config.rs @@ -24,6 +24,8 @@ pub struct Config { /// Piper voice name, used to resolve the model file when `tts_model_path` /// points at a directory. Ignored when it points at a `.onnx` file directly. pub tts_voice: String, + pub recording_enabled: bool, + pub recording_window_seconds: u64, } struct EnvVar { @@ -124,6 +126,18 @@ const ENV_VARS: &[EnvVar] = &[ default: Some("info"), description: "tracing/logging level filter", }, + EnvVar { + name: "RECORDING_ENABLED", + required: false, + default: Some("true"), + description: "enable continuous voice recording while in a VC (set false to opt out)", + }, + EnvVar { + name: "RECORDING_WINDOW_SECONDS", + required: false, + default: Some("900"), + description: "rolling recording buffer length in seconds (memory ~sample_rate*2 bytes/sec)", + }, ]; pub fn check_env_vars() { @@ -186,6 +200,14 @@ impl Config { .ok() .and_then(|v| v.parse().ok()), assistant_keyword: env::var("ASSISTANT_KEYWORD").unwrap_or_else(|_| "jarvis".into()), + recording_enabled: env::var("RECORDING_ENABLED") + .unwrap_or_else(|_| "true".into()) + .parse() + .unwrap_or(true), + recording_window_seconds: env::var("RECORDING_WINDOW_SECONDS") + .unwrap_or_else(|_| "900".into()) + .parse() + .unwrap_or(900), copyparty_url: env::var("COPYPARTY_URL") .unwrap_or_else(|_| "http://localhost:3939".into()), copyparty_url_upload: env::var("COPYPARTY_URL_UPLOAD") -- cgit v1.2.3