Get the current channel mapping, accounting for voice conversion on the capture path
#include <sys/asoundlib.h> snd_pcm_chmap_t * snd_pcm_get_chmap( snd_pcm_t *pcm );
The snd_pcm_get_chmap() function gets the current channel mapping for a PCM stream, accounting for voice conversion on the capture path.
A pointer to a snd_pcm_chmap_t structure that describes the mapping, or NULL if there isn't a mapping or an error occurred (errno is set). You must free this structure when you're done with it.
snd_pcm_chmap_t *chmap;
int i;
printf("Get channel map using snd_pcm_get_chmap()...\n");
if ((chmap = snd_pcm_get_chmap(pcm_handle)) == NULL )
{
fprintf(stderr, "snd_pcm_get_chmap failed: %s\n", snd_strerror(errno));
return -1;
}
printf("Number of channels = %d\n", chmap->channels);
for(i = 0; i < chmap->channels; i++)
printf("\tchmap.pos[%d] = %d\n", i, chmap->pos[i]);
free (chmap);
QNX Neutrino
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Read the Caveats |
This function isn't thread-safe if pcm (snd_pcm_t) is used across multiple threads.