Enumerating audio devices in GStreamer
Since it took me more than one hour to figure out (and the documentation wasn’t too helpful), here’s how to enumerate audio devices in GStreamer:
import gst
sink=gst.element_factory_make("pulsesink","mysink")
sink.probe_property_name("device")
devs = sink.probe_get_values_name("device")
Note that for some drivers (such as pulse) you explicitely need to call
probe first, before you can get values. Also note that the ALSA module
apparently only enumerates hardware devices, which probably is a bug in the
module (according to Lennart’s blog, you should use snd_device_name_hint
which seems to be the only function to get all the ALSA devices, including software devices such as dmix or the pulse linking module).