5

I'm using python to get the current selected audio device in windows. I'm using pyaudio now and open to use other libs.

What I have achieved:

with pyaudio's get_device_info_by_index I can list all audio devices.

with pyaudio's get_default_output_device_info I can get the default audio device(seems to me it's the internal audio device embedded in PC)

What I have tried:

If I plug in my headphone or connect the PC to some bluetooth speaker, I can use get_device_info_by_index to get new plugged devices. But get_default_output_device_info still gives me the default PC speaker.

So I need a way to find out the current selected speaker. For example, I connect headphone and bluetooth speaker to the PC, so I have 3 output speakers. Then I can use windows's control panel to select a speak to use.

I need a way to find out which one is selected in Python, either pyaudio or any other libs.

vego
  • 889
  • 1
  • 8
  • 20

0 Answers0