Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 8
Create a handle and open a connection to a specified audio interface
#include <sys/asoundlib.h>
int snd_pcm_open( snd_pcm_t **handle,
int card,
int device,
int mode );
- handle
- A pointer to a location where snd_pcm_open() stores a
handle for the audio interface.
You'll need this handle when you call the other snd_pcm_*
functions.
- card
- The card number.
- device
- The audio device number.
- mode
- One of:
- SND_PCM_OPEN_PLAYBACK — open the playback channel
(direction).
- SND_PCM_OPEN_CAPTURE — open the capture channel
(direction).
- SND_PCM_OPEN_DUPLEX — open both (playback and
capture) channels (directions).
You can OR this flag with any of the above:
libasound.so
The snd_pcm_open() function
creates a handle and opens a connection to the audio interface
for sound card number card and audio device number device.
It also checks if the protocol is compatible to prevent the use
of programs written to an older API with newer drivers.
There are no defaults; your application must specify all the arguments to
this function.
Zero on success, or a negative error code.
- -ENOMEM
- Not enough memory to allocate control structures.
See the example in
“Opening your PCM device”
in the Playing and Capturing Audio Data chapter.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
Successfully opening a PCM channel doesn't guarantee that there are enough
audio resources free to handle your application.
Audio resources (e.g. subchannels) are allocated when you configure the
channel by calling
snd_pcm_channel_params()
or
snd_pcm_plugin_params().
snd_pcm_close(),
snd_pcm_nonblock_mode(),
snd_pcm_open_preferred()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 201
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/audio/libs/snd_pcm_open.html on line 201