Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pulseaudio remote server support #54

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assist_microphone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
build-essential \
libasound2-plugins \
alsa-utils \
libpulse0 \
ffmpeg \
python3 \
python3-pip \
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion assist_microphone/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ codenotary:
signer: [email protected]
base_image: [email protected]
args:
HOMEASSISTANT_SATELLITE_VERSION: v2.2.0
HOMEASSISTANT_SATELLITE_VERSION: v2.3.0
8 changes: 7 additions & 1 deletion assist_microphone/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 2.2.3
version: 2.2.4
slug: assist_microphone
name: Assist Microphone
description: Stream microphone audio to Assist
Expand All @@ -23,6 +23,9 @@ options:
udp_mic: false
pipeline: ""
host: "homeassistant"
pulseserver: ""
pulseecho: true
pulseducking: 0.2
debug_logging: false
debug_recording_dir: ""
schema:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand Down
12 changes: 12 additions & 0 deletions assist_microphone/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) <IP|HOST>[: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