diff options
Diffstat (limited to '')
| -rw-r--r-- | src/config.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs index c05c3ae..09eabeb 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -75,7 +75,7 @@ pub struct Config { | |||
| 75 | pub llm_api_url: String, | 75 | pub llm_api_url: String, |
| 76 | pub database_path: String, | 76 | pub database_path: String, |
| 77 | /// Optional path to the Piper TTS `.onnx` model (or a directory of models). | 77 | /// Optional path to the Piper TTS `.onnx` model (or a directory of models). |
| 78 | /// When unset, TTS falls back to Google Translate TTS. | 78 | /// When unset, TTS commands fail; there is no external fallback. |
| 79 | pub tts_model_path: Option<String>, | 79 | pub tts_model_path: Option<String>, |
| 80 | /// Piper voice name, used to resolve the model file when `tts_model_path` | 80 | /// Piper voice name, used to resolve the model file when `tts_model_path` |
| 81 | /// points at a directory. Ignored when it points at a `.onnx` file directly. | 81 | /// points at a directory. Ignored when it points at a `.onnx` file directly. |
| @@ -168,7 +168,7 @@ const ENV_VARS: &[EnvVar] = &[ | |||
| 168 | name: "TTS_MODEL_PATH", | 168 | name: "TTS_MODEL_PATH", |
| 169 | required: false, | 169 | required: false, |
| 170 | default: None, | 170 | default: None, |
| 171 | description: "Path to a Piper TTS .onnx model (or a models directory). Unset => Google TTS fallback", | 171 | description: "Path to a Piper TTS .onnx model (or a models directory); TTS is disabled when unset", |
| 172 | }, | 172 | }, |
| 173 | EnvVar { | 173 | EnvVar { |
| 174 | name: "TTS_VOICE", | 174 | name: "TTS_VOICE", |
| @@ -284,11 +284,11 @@ impl Config { | |||
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | /// Resolve the Piper model path to pass to the `piper` CLI. | 287 | /// Resolve the Piper model path passed to `piper-rs` (in-process). |
| 288 | /// | 288 | /// |
| 289 | /// - `TTS_MODEL_PATH` set to a `.onnx` file => used verbatim. | 289 | /// - `TTS_MODEL_PATH` set to a `.onnx` file => used verbatim. |
| 290 | /// - `TTS_MODEL_PATH` set to a directory => `{dir}/{TTS_VOICE}.onnx`. | 290 | /// - `TTS_MODEL_PATH` set to a directory => `{dir}/{TTS_VOICE}.onnx`. |
| 291 | /// - `TTS_MODEL_PATH` unset => `None` (caller falls back to Google TTS). | 291 | /// - `TTS_MODEL_PATH` unset => `None` (TTS is unavailable). |
| 292 | pub fn piper_model_path(&self) -> Option<std::path::PathBuf> { | 292 | pub fn piper_model_path(&self) -> Option<std::path::PathBuf> { |
| 293 | let configured = self.tts_model_path.as_ref()?; | 293 | let configured = self.tts_model_path.as_ref()?; |
| 294 | let path = std::path::PathBuf::from(configured); | 294 | let path = std::path::PathBuf::from(configured); |
