bastibe / SoundCard

A Pure-Python Real-Time Audio Library
https://soundcard.readthedocs.io
BSD 3-Clause "New" or "Revised" License
689 stars 70 forks source link

error getting default mic #52

Closed ipelupessy closed 5 years ago

ipelupessy commented 5 years ago

on linux, I get the following error when trying to call default_microphone():

  File "/usr/lib/python3.7/site-packages/soundcard/pulseaudio.py", line 161, in _match_soundcard
    raise IndexError('no soundcard with id {}'.format(id))
IndexError: no soundcard with id alsa_output.pci-0000_00_1f.3.analog-stereo.monitor

default_speaker works, I can get all_microphones (which only contains 1)...

ipelupessy commented 5 years ago

the exception is caused by a monitor being the pulseaudio default source id - I am not sure why my configuration is setup this way (it does not seem a sane default)..in any case I have made a PR to cover this case...