I have been previously using pyaudio to get sound from the system (not mic) audio output, but had to specify the system output device ID manually. Is there a default device name that is used for inner system audio output for all Operating Systems?
For example, from Record speakers output with PyAudio, I see that user macost has suggested to use: "Stereo Mix (Realtek(R) Audio)", but is that ID general to all OS?
for i in range(p.get_device_count()):
dev = p.get_device_info_by_index(i)
if (dev['name'] == 'Stereo Mix (Realtek(R) Audio)' and dev['hostApi'] == 0): # THIS LINE
dev_index = dev['index'];
print('dev_index', dev_index)
Found the code from Record speakers output with PyAudio, but want to know, whether Realtek ID is common to everything.
Thanks!
After gaining more experience, I understood that asking PC to select default speaker on any OS is too much. Better approach would be to let your user choose Microphone and Speakers by providing a list of available devices and let them check if it's working as expected:
It's pretty easy to do and demo of it can be seen in any common video call apps, such as Zoom.