PyAudioWPatch icon indicating copy to clipboard operation
PyAudioWPatch copied to clipboard

PyAudioWPatch does not pick up when connect new device such as usb/bluetooth headset

Open minh-wp opened this issue 1 year ago • 1 comments

What problem are you facing?

  • [ ] audio isn`t recorded
  • [ ] audio is recorded with artifacts
  • [ ] problem with "silence"
  • [x ] other

What is the cause of the error (in your opinion)?

  • [ ] PyAudio\PortAudio bug
  • [ ] I just need help(or answer)

Before creating, complete the checklist:

If the problem is related to the inability to record sound from speakers, then before creating this issue, try to first record audio using the provided examples (for example, simple_recording_app.py)

Start your issue here 👇

  • once PyAudioWPatch is loaded, it only maintains the list of channels at the load time, we can not refresh it to pick up new plug-in devices such as usb/bluetooth headsets.
  • It would be great to also able to subscribe (or refresh) to pickup the defaultOutputDevice and defaultInputDevice when they are changed

minh-wp avatar Jun 07 '24 14:06 minh-wp

Hi🖐 Adding auto-detection can make the behavior of the library a little confusing, so this feature is rejected. But maybe I will add to the next release the ability to re-intialize an instance at runtime.

Now you can use Proxy-pattern to control PyAudio instance, and renew it on demand

s0d3s avatar Sep 23 '24 04:09 s0d3s

Would it be possible to have events/notification when the audio setting changes? (i.e: new bluetooth devices added) So, we can renew the instance to get the latest?

minh-wp avatar Dec 04 '24 21:12 minh-wp