feat(audio): add a family dictation tone picker (#707)

Settings → Audio can pick start/stop cues from the shared catalog
(lift, flick, ember, step, voca, soft, chirp, scale, drop, glass, off).
New installs and any missing or unknown sound_effects.tone value use
voca. A saved id, including off, is left alone.

The old start_recording/stop_recording files stay on disk. They are
no longer the implicit default. Error cues still follow the existing
enable switch.
This commit is contained in:
Jatin K Malik
2026-08-18 17:46:55 -07:00
committed by GitHub
parent 994dda10a6
commit fd23ef0d9d
48 changed files with 565 additions and 100 deletions
+33
View File
@@ -233,6 +233,39 @@ class TestConfigManagerSoundEffects:
assert "sound_effects" in manager.config
assert manager.config["sound_effects"]["enabled"] is False
def test_missing_tone_key_lands_on_voca(self):
from vocalinux.ui.config_manager import ConfigManager
manager = ConfigManager.__new__(ConfigManager)
manager.config = {"sound_effects": {"enabled": True}}
assert manager.get_sound_effects_tone() == "voca"
def test_unknown_tone_lands_on_voca(self):
from vocalinux.ui.config_manager import ConfigManager
manager = ConfigManager.__new__(ConfigManager)
manager.config = {"sound_effects": {"enabled": True, "tone": "fifth"}}
assert manager.get_sound_effects_tone() == "voca"
assert manager.config["sound_effects"]["tone"] == "fifth"
def test_explicit_saved_tone_is_left_alone(self):
from vocalinux.ui.config_manager import SOUND_EFFECT_TONE_IDS, ConfigManager
manager = ConfigManager.__new__(ConfigManager)
for tone_id in SOUND_EFFECT_TONE_IDS:
manager.config = {"sound_effects": {"enabled": True, "tone": tone_id}}
assert manager.get_sound_effects_tone() == tone_id
def test_set_sound_effects_tone_persists(self):
from vocalinux.ui.config_manager import ConfigManager
manager = ConfigManager.__new__(ConfigManager)
manager.config = {}
manager.set_sound_effects_tone("off")
assert manager.get_sound_effects_tone() == "off"
manager.set_sound_effects_tone("lift")
assert manager.get_sound_effects_tone() == "lift"
class TestConfigManagerUpdateDictRecursive:
"""Tests for _update_dict_recursive method."""