From 4731121de02bff300f2be5e3c532afa2e86e22a5 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 13 Oct 2023 12:00:15 -0500 Subject: [PATCH] Assist microphone 2.2.0 --- assist_microphone/CHANGELOG.md | 8 ++++++ assist_microphone/DOCS.md | 26 +++++-------------- assist_microphone/Dockerfile | 4 +-- assist_microphone/build.yaml | 2 +- assist_microphone/config.yaml | 8 +++--- .../s6-overlay/s6-rc.d/assist_microphone/run | 3 +-- assist_microphone/translations/en.yaml | 14 ++++------ 7 files changed, 26 insertions(+), 39 deletions(-) diff --git a/assist_microphone/CHANGELOG.md b/assist_microphone/CHANGELOG.md index 2cc209b..c38db6d 100644 --- a/assist_microphone/CHANGELOG.md +++ b/assist_microphone/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.2.0 + +- Upgrade to `homeassistant-satellite` v2.2.0 +- Use alsa/pulse instead of libportaudio +- Add `pipeline` option to run a different pipeline by name +- Remove `mic_device` and `snd_device` +- Clean up docs + ## 1.2.0 - Add `volume_multiplier` diff --git a/assist_microphone/DOCS.md b/assist_microphone/DOCS.md index f117898..595c0a4 100644 --- a/assist_microphone/DOCS.md +++ b/assist_microphone/DOCS.md @@ -15,7 +15,7 @@ or follow these steps to manually install the add-on: 1. Navigate in your Home Assistant frontend to **Settings** -> **Add-ons** -> **Add-on store**. 2. Add the store https://github.com/rhasspy/hassio-addons -3. Find the "porcupine1" add-on and click it. +3. Find the "Assist Microphone" add-on and click it. 3. Click on the "INSTALL" button. ## How to use @@ -31,16 +31,6 @@ To create a token: 6. Paste the token into this add-on's configuration page 7. Click **Save** and then start the add-on -After this add-on is running, it will be automatically discovered by the Wyoming -integration in Home Assistant. To finish the setup, click the following my -button: - -[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=wyoming) - -Alternatively, you can install the Wyoming integration manually, see the -[Wyoming integration documentation](https://www.home-assistant.io/integrations/wyoming/) -for more information. - ## Configuration ### Option: `token` @@ -63,7 +53,11 @@ Automatic volume boost for microphone (0 is disabled, 31 dbfs is max). A value o ### Option: `volume_multiplier` -Multiply volume by fixed value (1.0 = no change, 2.0 = twice as loud). 1.0 is the default. +Multiply microphone volume by fixed value (1.0 = no change, 2.0 = twice as loud). 1.0 is the default. + +### Option: `pipeline` + +Name of pipeline to run. The preferred pipeline is run by default. ### Option: `wake_buffer_seconds` @@ -73,14 +67,6 @@ Seconds of audio to keep for STT after wake word is detected. If you disable the True if audio will be sent via UDP on port 5000 (raw 16-bit 16Khz mono PCM). -### Option: `mic_device` - -Number or name of microphone device (audio input). You should probably change the audio input device at the bottom of the configuration page instead of this. - -### Option: `snd_device` - -Number or name of sound device (audio output). You should probably change the audio input device at the bottom of the configuration page instead of this. - ### Option: `volume` Playback volume from 0 (mute) to 1 (max). diff --git a/assist_microphone/Dockerfile b/assist_microphone/Dockerfile index b0cd3a3..8022dd9 100644 --- a/assist_microphone/Dockerfile +++ b/assist_microphone/Dockerfile @@ -13,7 +13,7 @@ RUN \ && apt-get install -y --no-install-recommends \ build-essential \ libasound2-plugins \ - libportaudio2 \ + alsa-utils \ ffmpeg \ python3 \ python3-pip \ @@ -23,7 +23,7 @@ RUN \ setuptools \ wheel \ && pip3 install --no-cache-dir \ - "homeassistant_satellite[silerovad]@https://github.com/synesthesiam/homeassistant-satellite/archive/refs/tags/${HOMEASSISTANT_SATELLITE_VERSION}.tar.gz" \ + "homeassistant_satellite[silerovad,webrtc]@https://github.com/synesthesiam/homeassistant-satellite/archive/refs/tags/${HOMEASSISTANT_SATELLITE_VERSION}.tar.gz" \ \ && apt-get remove --yes build-essential python3-dev \ && apt-get clean \ diff --git a/assist_microphone/build.yaml b/assist_microphone/build.yaml index 85560a8..e39afff 100644 --- a/assist_microphone/build.yaml +++ b/assist_microphone/build.yaml @@ -6,4 +6,4 @@ codenotary: signer: notary@home-assistant.io base_image: notary@home-assistant.io args: - HOMEASSISTANT_SATELLITE_VERSION: v1.2.0 + HOMEASSISTANT_SATELLITE_VERSION: v2.2.0 diff --git a/assist_microphone/config.yaml b/assist_microphone/config.yaml index 566830a..65fe153 100644 --- a/assist_microphone/config.yaml +++ b/assist_microphone/config.yaml @@ -1,5 +1,5 @@ --- -version: 1.2.1 +version: 2.2.0 slug: assist_microphone name: Assist Microphone description: Stream microphone audio to Assist @@ -12,8 +12,6 @@ map: options: token: null vad: "disabled" - mic_device: "" - snd_device: "" volume: 1.0 awake_sound: "/usr/src/sounds/awake.wav" done_sound: "/usr/src/sounds/done.wav" @@ -22,13 +20,12 @@ options: volume_multiplier: 1.0 wake_buffer_seconds: 0.0 udp_mic: false + pipeline: "" debug_logging: false debug_recording_dir: "" schema: token: str vad: list(disabled|webrtcvad|silero) - mic_device: str - snd_device: str volume: float noise_suppression: int auto_gain: int @@ -37,6 +34,7 @@ schema: done_sound: str wake_buffer_seconds: float udp_mic: bool + pipeline: str debug_logging: bool debug_recording_dir: str init: false diff --git a/assist_microphone/rootfs/etc/s6-overlay/s6-rc.d/assist_microphone/run b/assist_microphone/rootfs/etc/s6-overlay/s6-rc.d/assist_microphone/run index 36e3e2e..9319898 100755 --- a/assist_microphone/rootfs/etc/s6-overlay/s6-rc.d/assist_microphone/run +++ b/assist_microphone/rootfs/etc/s6-overlay/s6-rc.d/assist_microphone/run @@ -17,8 +17,6 @@ fi exec python3 -m homeassistant_satellite \ --host 'homeassistant' \ --token "$(bashio::config 'token')" \ - --mic-device "$(bashio::config 'mic_device')" \ - --snd-device "$(bashio::config 'snd_device')" \ --volume "$(bashio::config 'volume')" \ --awake-sound "$(bashio::config 'awake_sound')" \ --done-sound "$(bashio::config 'done_sound')" \ @@ -27,4 +25,5 @@ exec python3 -m homeassistant_satellite \ --auto-gain "$(bashio::config 'auto_gain')" \ --volume-multiplier "$(bashio::config 'volume_multiplier')" \ --vad "$(bashio::config 'vad')" \ + --pipeline "$(bashio::config 'pipeline')" \ --debug-recording-dir "$(bashio::config 'debug_recording_dir')" ${extra_args[@]} diff --git a/assist_microphone/translations/en.yaml b/assist_microphone/translations/en.yaml index 6fbcc40..3657d91 100644 --- a/assist_microphone/translations/en.yaml +++ b/assist_microphone/translations/en.yaml @@ -19,7 +19,11 @@ configuration: volume_multiplier: name: Volume multiplier description: >- - Multiply volume by fixed value (1.0 = no change, 2.0 = twice as loud) + Multiply microphone volume by fixed value (1.0 = no change, 2.0 = twice as loud) + pipeline: + name: Pipeline + description: >- + Name of pipeline to run. The preferred pipeline is run by default. wake_buffer_seconds: name: Wake buffer seconds description: >- @@ -28,14 +32,6 @@ configuration: name: UDP Microphone description: >- True if audio will be sent via UDP on port 5000 (raw 16-bit 16Khz mono PCM). - mic_device: - name: Microphone device - description: >- - Number or name of microphone device (audio input) - snd_device: - name: Sound device - description: >- - Number or name of sound device (audio output) volume: name: Volume description: >-