serenadeai / speech-recorder

speech-recorder is a node.js module for streaming audio from a device's microphone and filtering for speech.
MIT License
86 stars 19 forks source link

Fix device list not being updated #38

Open dsouza95 opened 1 year ago

dsouza95 commented 1 year ago

This draft PR fixes #36. By calling PA_terminate on every GetDevices call, we ensure the device list is properly updated. I modified the devices example to call GetDevices every 5 seconds, so it is easy to add/remove any device and verify this behavior (not sure if that should be another example, or if that is needed at all).

I tested this fix on an Ubuntu 22.04, but didn´t manage to build on my Windows 10 (tried Msys2 MinGW64 and Cygwin). Is there a recommended setup for Windows builds?