Commit Graph
46 Commits
Author SHA1 Message Date
Omar Amin 3ea32895ee Wake word sensitivity (#207)
## Summary
- Introduces configurable wake word and stop word sensitivity
- Adds UI-controllable thresholds for wake word detection
- Refactors wake word loading and handling logic
- Improves audio preprocessing and runtime behavior

## Key Features
- Per-wake-word sensitivity configuration (Wake Word 1 & 2)
- Configurable stop word sensitivity
- Fine-grained numeric control (0.0 – 1.0, step 0.001)
- Sensitivity values exposed as Number Entities for Home Assistant
- Persistent storage of user-defined sensitivity values

## Wake Word Handling
- Support for model-specific default thresholds (`probability_cutoff`)
- Automatic fallback to defaults if no user value is set
- Separate thresholds for:
  - Wake Word 1
  - Wake Word 2
  - Stop Word
- Unified handling for MicroWakeWord and OpenWakeWord models

## UI / API Integration
- Adds new Home Assistant entities:
  - `WakeWord1SensitivityNumberEntity`
  - `WakeWord2SensitivityNumberEntity`
  - `StopWordSensitivityNumberEntity`
- Entities support:
  - Live updates
  - Persistence via preferences
  - Synchronization with runtime state
- Pushes updated values to Home Assistant on startup

## Refactoring
- Extracted wake word logic into `wake_word.py`
  - Model discovery
  - Model loading
  - Stop word handling
- Simplified `__main__.py` by delegating wake word responsibilities
- Improved separation between configuration and runtime state

## Additional Changes
- Improved debug logging across initialization and runtime

## Impact
- Enables fine-tuning of wake word detection accuracy
- Reduces false positives and missed triggers
- Improves usability via UI-based configuration
- Provides better flexibility across different environments and microphones
2026-04-21 02:04:11 +02:00
Omar Amin c284806b73 Add the ability to control microphone volume (#287)
Control microphone volume via UI in device page. Set to the maximum by default and saved in preferences to restore upon restarts.
2026-04-10 01:33:34 +02:00
aryanhasgithub 4ee7bb04bc Add support for WebRTC Auto Gain and Noise Suppression (#250)
## WebRTC Auto Gain & Noise Suppression
 
This PR adds support for WebRTC Auto Gain and Noise Suppression as previously implemented in the Wyoming Satellite project.
 
### What's New
 
Two new entities have been created a number slider for gain and another one for noise suppression. The processing happens inside of the `webrtc.py` file and is implemented in the `__main__.py` file's `process_audio` function. The slider for gain has a limit of 0-31 and noise suppression has a limit of 0-4.
 
The Auto Gain and Noise Suppression persist through restarts and are saved as preferences. The values are dynamically chnged without needing a restart.
 
CLI flags called `--mic-auto-gain` and `--mic-noise-suppression` have also been added.
 
>  When both values are 0, WebRTC processing is bypassed entirely with no performance overhead.

Closes #25 
 
### Testing
 
When saving the audio recorded by LVA there is a noticeable increase. The following two files have been recorded with similar audio being played through them with these results (Gain-31 and NS-4):
 
| Metric | With AGC+NS | Without |
|---|---|---|
| Max amplitude | 0.329 | 0.054 |
| RMS amplitude | 0.008905 | 0.002862 |
| Volume adjustment needed | 3.034x | 13.479x |
| Rough frequency | 916 Hz | 705 Hz |
2026-04-09 00:43:11 +02:00
JaminandFlorian Asche 7732be0de8 Output only satellite (#182)
Output only satellite for nodes with only speakers and no microphone.
Supports announcements and playing media only.

---------

Co-authored-by: Florian Asche <github@florian-asche.de>
2026-03-31 01:56:16 +02:00
Omar Amin 88fb2c5a49 Start listening after stopping ringing timer using wake word (#275)
Wake-up after stopping ringing timer using wake words such as "Okay Nabu", "Hey Jarvis" rather than "Stop" to get another command instead of the need to repeat the wake word.
2026-03-31 00:11:25 +02:00
Omar Amin 412035e6b2 Fix lint formatting (#262) 2026-03-26 14:54:40 +02:00
Omar Amin 4194aa42ec Add maximum seconds for ringing timer (#261)
Auto stop ringing timer if the determined time (default 15 mins) has passed without manually stopping. This max time can be modified using the command `--timer-max-ring-seconds`.
2026-03-25 01:46:53 +02:00
Vlad GaevskyandOmar Amin 96fd54a008 Fix double _tts_finished() call when stop word interrupts TTS (#256)
tts_player.stop() already invokes its done_callback which is
_tts_finished(), so the explicit self._tts_finished() call immediately
after was a duplicate. This caused double 'Unducking music' and double
'TTS response finished' log entries on every stop-word-triggered stop.

Also move _pipeline_active = False inside the 'if not self._tts_played'
branch in VOICE_ASSISTANT_RUN_END, so it is not cleared while TTS is
still playing.

Co-authored-by: Omar Amin <65174210+omaramin-2000@users.noreply.github.com>
2026-03-23 16:24:38 +01:00
Florian Asche 1fc29241b4 Add linting scripts and pipeline (#201)
* Add linting scripts and pipeline
2026-03-05 01:58:39 +01:00
Florian Asche 68d2890fdd fix: ensure wake word state is set after the wake sound (#198) 2026-03-04 01:07:19 +01:00
Ethan Kiczek a30a10c95a Prevent wake word from interrupting active voice pipeline (#151)
* Prevent wake word from interrupting active voice pipeline
2026-03-04 00:54:19 +01:00
Florian Asche ecace7011f bugfix: start listening after wakeup sound (#185) 2026-03-01 21:01:35 +01:00
Florian Asche 80e0d6254e Fix: Suppress spurious end-file event when starting playback and tts.speak (#179)
* bugfix: supress first end of file event and only callback on second one
* add some notes on testing
* fixed tts.speak
* fix unduck after timer end
* use custom docker-entrypoint on dev container
* change mv to copy in the docs when using .env file
2026-02-26 01:31:18 +01:00
Omar Amin 981a786a46 Merge branch 'main' into Volume-Persistence-Across-Restarts 2026-02-21 22:19:05 +02:00
Florian Asche 7de510cb1f Add version and hash to docker container (#167)
* Add version and git hash to image
* Add version reporting to HA via api
2026-02-21 20:38:46 +01:00
Omar Amin 38c064fc68 Update media player entity volume handling
Set the volume and previous volume for the media player entity based on the current state.
2026-02-21 16:27:06 +02:00
Omar Amin 282aa7ecf0 Handle announcement separately from the media player
Update the announcement handling to just duck the music player volume instead of pausing it.
2026-02-08 16:11:11 +02:00
Florian Asche 76cd246029 removed disconnected log message in process_packet function 2026-02-08 04:32:37 +01:00
Jamin Hitchcock 4b7242a1d3 Fix some format and linting issues 2026-02-02 04:15:17 +00:00
Omar Amin 8cc7f175a0 Merge branch 'main' into beta 2026-01-27 22:08:15 +02:00
Omar Amin 3ddcac6e48 Update satellite.py 2026-01-27 19:03:38 +02:00
Omar Amin 5186570bce Fix the switch state
Fix the reverting thinking sound switch when toggling
2026-01-27 01:36:37 +02:00
Omar Amin ed2065423e Update satellite.py 2026-01-24 21:59:24 +02:00
Omar Amin e1f5227174 Update satellite.py
Initialize the self._pipeline_active to fix issue #87
2026-01-24 21:37:07 +02:00
Omar Amin fcd1ab9969 Update satellite.py
Fix issue #87
2026-01-24 21:02:29 +02:00
Omar Amin 25a15d0366 Update satellite.py 2026-01-24 18:33:08 +02:00
Omar Amin 19ab96efad Merge branch 'OHF-Voice:main' into Add-mute/unmute-sounds 2026-01-21 15:57:53 +02:00
Omar Amin 689079598c Update satellite.py 2026-01-21 14:57:27 +02:00
Omar Amin 10713a7e70 Update satellite.py 2026-01-21 14:54:08 +02:00
Omar Amin 8743861738 Update satellite.py 2026-01-21 13:17:06 +02:00
Omar Amin 1352cb3ac3 Add mute/unmute sounds
Play the same mute/unmute sounds in the voice pe
2026-01-21 01:51:53 +02:00
Omar Amin 351886ea98 Update satellite.py 2026-01-21 01:33:56 +02:00
Omar Amin 472fd4239b Add mute switch functionality 2026-01-21 00:30:03 +02:00
Omar Amin acdeda866b Merge branch 'main' into main 2025-11-12 15:44:11 +02:00
Michael Hansen 716fe30c29 Support custom/external wake words 2025-11-11 15:19:15 -06:00
Omar Amin be7ed5e9fb Update satellite.py 2025-11-06 01:16:19 +02:00
Omar Amin c4afd84cae Update satellite.py 2025-11-05 16:46:45 +02:00
Omar Amin f81a119239 Add thinking sound switch 2025-11-05 16:23:25 +02:00
Omar Amin 29a3202189 Merge branch 'OHF-Voice:main' into main 2025-11-04 15:46:29 +02:00
Michael Hansen 72c8f021c8 Use pymicro-wakeword and pyopen-wakeword libraries 2025-10-16 14:29:48 -05:00
Omar Amin 79e6648ab2 Update satellite.py 2025-09-26 21:52:14 +03:00
Michael Hansen 7a4b3e661a Add zeroconf discovery 2025-09-18 10:52:56 -05:00
Michael Hansen d5300ae694 Support openWakeWord 2025-09-16 15:05:18 -05:00
Michael Hansen e26864a191 Support multiple wake words 2025-09-15 11:29:28 -05:00
Michael Hansen 2c937e3cb3 Save preferences to JSON file 2025-09-15 11:06:09 -05:00
Michael Hansen ea901a1c14 Small refactor 2025-09-15 10:43:51 -05:00