Count the sound cards and list their card numbers in an array
#include <sys/asoundlib.h> int snd_cards_list( int *cards, int card_array_size, int *cards_over );
The snd_cards_list() function returns the instantaneous number of sound cards that have running drivers. There's no guarantee that the sound cards have contiguous card numbers, and cards may be unmounted at any time.
You should use this function instead of snd_cards() because snd_cards_list() can fill in an array of card numbers. This overcomes the difficulties involved in hunting a (possibly) non-contiguous list of card numbers for active cards.
The number of sound cards.
QNX Neutrino
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |