I use ALSA to play PCM samples. I open the PCM stream with this function:
int snd_pcm_open(snd_pcm_t** pcmp,
const char* name,
snd_pcm_stream_t stream,
int mode);
I'm currently using "default" as the name parameter. I would like to be able to choose other devices. What I cannot understand is how I can determine what are the names of the other available devices.
I attached a USB microphone to my system and aplay and amixer seems to detect the new device. How do I determine the name of that device? Is there any ALSA function to get a list of available devices with their respective names?
name
isn't freed when in the second part of the if statement0 != strcmp("null", name)
when the name does equal"null"
. Perhaps add an extra if inside the if to do someting usefull with name when it doesn't equal"null"
, but always free it. – Anxiety