synesthesiam / homeassistant-satellite

Streaming audio satellite for Home Assistant
MIT License
186 stars 23 forks source link

Add support for PyAudio (now working on MacOS!) #45

Closed bertybuttface closed 11 months ago

bertybuttface commented 11 months ago

This will help with supporting mac.

I've tested that this runs but I have not been able to get wake word detection working. I think maybe it is sending garbage data to the server.

I'll try and pick it up next week but it is here if someone wants to play with it.

Use the --pyaudio flag

bertybuttface commented 11 months ago

I think pyaudio supports windows too so could help with: https://github.com/synesthesiam/homeassistant-satellite/issues/23

bertybuttface commented 11 months ago

How to Install PyAudio (on Mac):

xcode-select --install
brew remove portaudio
brew install portaudio
pip install pyaudio

If you are having trouble, use this command instead to specify your build locations for portaudio:

pip install --global-option='build_ext' --global-option="-I$(brew --prefix)/include" --global-option="-L$(brew --prefix)/lib" pyaudio
bertybuttface commented 11 months ago

Ok using --debug-recording-dir I can see hear the wav files are fine and using debug logging on the Home Assistant Open Wakeword Addon I can see the data is being received by the server.

bertybuttface commented 11 months ago

Ok it was just my weird voice, wake word detection works fine for my partner so this is good to go from a recording point of view. I haven't tested playback yet.

bertybuttface commented 11 months ago

Playback works but it seems there is quite a long delay.

bertybuttface commented 11 months ago

This is ready to merge.

beqabeqa473 commented 11 months ago

it is better to use miniaudio instead of pyaudio

bertybuttface commented 11 months ago

it is better to use miniaudio instead of pyaudio

Why?

bertybuttface commented 11 months ago

Closed in favour of #46 and #47