diff --git a/assist_microphone/Dockerfile b/assist_microphone/Dockerfile index 8022dd9..46fab4d 100644 --- a/assist_microphone/Dockerfile +++ b/assist_microphone/Dockerfile @@ -14,6 +14,7 @@ RUN \ build-essential \ libasound2-plugins \ alsa-utils \ + libpulse0 \ ffmpeg \ python3 \ python3-pip \ @@ -23,7 +24,7 @@ RUN \ setuptools \ wheel \ && pip3 install --no-cache-dir \ - "homeassistant_satellite[silerovad,webrtc]@https://github.com/synesthesiam/homeassistant-satellite/archive/refs/tags/${HOMEASSISTANT_SATELLITE_VERSION}.tar.gz" \ + "homeassistant_satellite[silerovad,webrtc,pulseaudio]@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 e39afff..4a30ad8 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: v2.2.0 + HOMEASSISTANT_SATELLITE_VERSION: v2.3.0 diff --git a/assist_microphone/config.yaml b/assist_microphone/config.yaml index d894c79..d76cd2c 100644 --- a/assist_microphone/config.yaml +++ b/assist_microphone/config.yaml @@ -1,5 +1,5 @@ --- -version: 2.2.3 +version: 2.2.4 slug: assist_microphone name: Assist Microphone description: Stream microphone audio to Assist @@ -23,6 +23,9 @@ options: udp_mic: false pipeline: "" host: "homeassistant" + pulseserver: "" + pulseecho: true + pulseducking: 0.2 debug_logging: false debug_recording_dir: "" schema: @@ -38,6 +41,9 @@ schema: udp_mic: bool pipeline: str host: str + pulseserver: str + pulseecho: bool + pulseducking: float 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 b5c6051..36b025e 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 @@ -18,6 +18,16 @@ if [ "$(bashio::core.ssl)" == 'true' ]; then extra_args+=('--protocol' 'https') fi +if [ "$(bashio::config 'pulseserver')" != "" ]; then + extra_args+=('--pulseaudio' $(bashio::config 'pulseserver')) + if [ "$(bashio::config 'pulseecho')" != 'true' ]; then + extra_args+=('--echo-cancel') + fi + if [ "$(bashio::config 'pulseducking')" != "" ]; then + extra_args+=('--ducking' $(bashio::config 'pulseducking')) + fi +fi + exec python3 -m homeassistant_satellite \ --host "$(bashio::config 'host')" \ --port "$(bashio::core.port)" \ diff --git a/assist_microphone/translations/en.yaml b/assist_microphone/translations/en.yaml index d2c9cd7..f4511fa 100644 --- a/assist_microphone/translations/en.yaml +++ b/assist_microphone/translations/en.yaml @@ -56,5 +56,17 @@ configuration: name: Debug recording directory description: >- Directory to save audio for debugging purposes. Should be in /share + pulseserver: + name: Puseaudio Server + description: >- + Pulseaudio server IP or host and Port (optional) [:PORT] + pulseecho: + name: Puseaudio Echo Cancel + description: >- + Enable Pulseaudio Echo Cancel + pulseducking: + name: Puseaudio Server Ducking + description: >- + Enable Pulseaudio duking. Lower down playback streams to the volume level on this setting (e.g., 0.2 for 20%) after the wake word is detected and until the pipeline finishes, making speech recognition easier network: 5000/udp: raw 16-bit 16Khz mono PCM audio