mk-fg / python-pulse-control

Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)
https://pypi.org/project/pulsectl/
MIT License
170 stars 36 forks source link

Add get_card_by_name like source/sink #38

Closed pvizeli closed 4 years ago

pvizeli commented 4 years ago

That is usefully and allow to get an card by name without loop over the full list.

mk-fg commented 4 years ago

I think you forgot to add type-info wrapper for C function to _pulsectl there, but I've added it in 3225ebd along with pulse.get_card_by_name(), same as in PR.

These names seem to be generated from hardware bus connection numbers, e.g. alsa_card.pci-0000_00_14.2 here, so probably bit hard to predict in advance, but guess easy to specify in various config files that way.

Thanks!