diff --git a/.gitignore b/.gitignore index cffe9d7..f644bab 100644 --- a/.gitignore +++ b/.gitignore @@ -180,7 +180,5 @@ cython_debug/ .cursorignore .cursorindexingignore -# Local recorder sound files -sounds/*.wav .DS_Store recorder_dynamic_user_config*.py diff --git a/README.md b/README.md index fe30379..0c85852 100644 --- a/README.md +++ b/README.md @@ -349,12 +349,13 @@ The repository deliberately does not publish live user configuration, signed pla ## Optional sounds -Recorder and the Coordinator use separate optional local sound files: +Recorder and the Coordinator use optional local sound files from the shared `sounds/` folder: ```text -alarm.wav -sounds/refresh.wav -sounds/launch.wav +sounds/ + alarm.wav + refresh.wav + launch.wav ``` - `alarm.wav` — recording-engine alarm sound for serious runtime conditions. @@ -363,7 +364,7 @@ sounds/launch.wav Coordinator launch notification takes priority when both Coordinator notification conditions happen in the same scan. Recorder and Coordinator sounds respect their sound-snooze controls. -These optional local sound assets are not included in the repository. +These sound assets are included in the repository under `sounds/`. --- diff --git a/record_dynamic.py b/record_dynamic.py index 75648dd..20b365f 100644 --- a/record_dynamic.py +++ b/record_dynamic.py @@ -2316,12 +2316,16 @@ def _alarm_beep_fallback_loop( stop_event.wait(float(NM3U8DL_ALARM_BEEP_GAP_SEC)) def _resolve_alarm_sound_path() -> Optional[str]: - # ALARM_SOUND_FILENAME may be absolute or relative to this script folder. + # ALARM_SOUND_FILENAME may be absolute or relative to the shared sounds folder. try: if os.path.isabs(ALARM_SOUND_FILENAME): p = ALARM_SOUND_FILENAME else: - p = os.path.join(os.path.dirname(os.path.abspath(__file__)), ALARM_SOUND_FILENAME) + p = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + "sounds", + ALARM_SOUND_FILENAME, + ) except Exception: return None return p diff --git a/sounds/alarm.wav b/sounds/alarm.wav new file mode 100644 index 0000000..514d2d2 Binary files /dev/null and b/sounds/alarm.wav differ diff --git a/sounds/launch.wav b/sounds/launch.wav new file mode 100644 index 0000000..d2a1ee2 Binary files /dev/null and b/sounds/launch.wav differ diff --git a/sounds/refresh.wav b/sounds/refresh.wav new file mode 100644 index 0000000..83ce336 Binary files /dev/null and b/sounds/refresh.wav differ diff --git a/tests/test_architecture.py b/tests/test_architecture.py index 62931b7..552b968 100644 --- a/tests/test_architecture.py +++ b/tests/test_architecture.py @@ -65,6 +65,14 @@ def test_recorder_and_coordinator_share_sound_snooze_runtime_core(self): self.assertIn("from recorder_runtime import sound as runtime_sound", recorder) self.assertIn("from recorder_runtime import sound as runtime_sound", coordinator) + def test_recorder_alarm_uses_shared_sounds_directory(self): + recorder=(ROOT/"record_dynamic.py").read_text(encoding="utf-8") + start=recorder.index("def _resolve_alarm_sound_path()") + end=recorder.index("def _shared_alarm_sound_loop(", start) + resolver=recorder[start:end] + self.assertIn('"sounds"', resolver) + self.assertIn("ALARM_SOUND_FILENAME", resolver) + def test_coordinator_config_and_acquisition_have_single_module_owners(self): entry=(ROOT/"recorder_event_coordinator.py").read_text(encoding="utf-8") config=(ROOT/"recorder_coordinator"/"configuration.py").read_text(encoding="utf-8")