Parcourir la source

Changed location of audio file

Efren Yevale Varela il y a 1 mois
Parent
commit
16053d8141
7 fichiers modifiés avec 11 ajouts et 11 suppressions
  1. 1 1
      .gitignore
  2. 3 3
      AGENTS.md
  3. 1 1
      docs/AUDIO-SETUP.md
  4. 1 1
      docs/CLI.md
  5. 1 1
      docs/DEVELOPMENT.md
  6. 2 2
      src/stt_daemon/state.py
  7. 2 2
      tests/test_state.py

+ 1 - 1
.gitignore

@@ -9,7 +9,7 @@
 .ruff_cache/
 .venv/
 __pycache__/
-audio/
+audio.json
 audit/
 build/
 config.toml

+ 3 - 3
AGENTS.md

@@ -60,7 +60,7 @@ publish-only.
 - Mapping is **manual** — no pydantic/dynaconf. Adding a key means editing the dataclass *and*
   `load_config()` in `config.py`. Unknown top-level sections warn and are ignored; unknown keys
   *inside* a known section are silently ignored (`dict.get` per field).
-- Env vars: `STT_DAEMON_STATE` (provisioning state; default `audio/audio.json` in the cwd),
+- Env vars: `STT_DAEMON_STATE` (provisioning state; default `audio.json` in the cwd),
   `XDG_RUNTIME_DIR` (sockets), `HF_HOME` (Whisper cache, honored by faster-whisper/huggingface).
 - `[triage]` is the display-only signal panel, off by default (`enabled = false`). Its
   `questions_file` (`questions.json` in the cwd) is private user state and is gitignored, like
@@ -111,8 +111,8 @@ publish-only.
 
 ## Conventions & gotchas
 
-- Never commit gitignored runtime output: `config.toml`, `transcripts/`, `audio/`, `audit/`,
-  `triage/`, `brief/`, `debug/`, `speakers/` (biometric), `models/`, `.omo/`.
+- Never commit gitignored runtime output: `config.toml`, `transcripts/`, `audio.json`, `audio/`,
+  `audit/`, `triage/`, `brief/`, `debug/`, `speakers/` (biometric), `models/`, `.omo/`.
 - New assistant tools: register in `assistant/tools.py`. Model-supplied arguments are JSON-parsed and
   schema-validated before running; set `side_effect` and `requires_confirmation` for anything
   non-read-only.

+ 1 - 1
docs/AUDIO-SETUP.md

@@ -114,7 +114,7 @@ The daemon uses PulseAudio's module system to create a virtual microphone from m
 
 When you run `uv run stt-daemon setup`, the daemon:
 - Creates all modules and records their numeric IDs
-- Saves the state to `audio/audio.json` (or `$STT_DAEMON_STATE`)
+- Saves the state to `audio.json` (or `$STT_DAEMON_STATE`)
 - Allows `run` to re-provision if the sink is missing (e.g., after reboot)
 - Allows `clear` to unload the modules it created — and falls back to
   name-based discovery (`sink_name`/`remap_source_name` in

+ 1 - 1
docs/CLI.md

@@ -67,7 +67,7 @@ uv run stt-daemon clear --yes
 ```
 
 This unloads all tracked modules and removes the state file. If
-`audio/audio.json` is already gone (reboot, manual
+`audio.json` is already gone (reboot, manual
 delete, crash), `clear --yes` still finds orphaned modules by name
 (`VirtualMicSink`/`VirtualMic` via `pactl list short modules`) and unloads
 them in reverse order (loopbacks → remap-source → null-sink), so the

+ 1 - 1
docs/DEVELOPMENT.md

@@ -37,7 +37,7 @@ src/stt_daemon/
 ├── audio.py             - Audio capture (parec, sounddevice)
 ├── pulse.py             - PulseAudio/pactl wrapper (devices, modules, sink checks)
 ├── provisioner.py       - Virtual sink + loopback lifecycle (setup/ensure/teardown)
-├── state.py             - Provisioning state file (audio/audio.json)
+├── state.py             - Provisioning state file (audio.json)
 ├── picker.py            - Interactive device picker (questionary / numbered menu)
 ├── segmenter.py         - VAD + pre-roll buffer + utterance segmentation (core)
 ├── transcriber.py       - Faster-Whisper wrapper

+ 2 - 2
src/stt_daemon/state.py

@@ -33,11 +33,11 @@ class StateStore:
 
         Args:
             path: Path to the state file. If None, uses `$STT_DAEMON_STATE` or
-                `audio/audio.json` relative to the current directory.
+                `audio.json` relative to the current directory.
         """
         if path is None:
             env_path = os.environ.get("STT_DAEMON_STATE")
-            path = Path(env_path) if env_path else Path("audio") / "audio.json"
+            path = Path(env_path) if env_path else Path("audio.json")
         self.path = path
 
     def load(self) -> AudioState | None:

+ 2 - 2
tests/test_state.py

@@ -88,12 +88,12 @@ def test_state_store_default_path_env_var(tmp_path, monkeypatch):
 
 
 def test_state_store_default_path_is_project_local(tmp_path, monkeypatch):
-    """Without overrides the state lives in ./audio/audio.json, inside the project."""
+    """Without overrides the state lives in ./audio.json, inside the project."""
     monkeypatch.delenv("STT_DAEMON_STATE", raising=False)
 
     store = StateStore()
 
-    assert store.path == Path("audio") / "audio.json"
+    assert store.path == Path("audio.json")
 
 
 def test_state_store_creates_parent_dirs(tmp_path):