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_write.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_write.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_write.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_write.html on line 8
Transfer PCM data to playback channel
#include <sys/asoundlib.h>
ssize_t snd_pcm_write( snd_pcm_t *handle,
const void *buffer,
size_t size );
- handle
- The handle for the PCM device, which you must have opened by calling
snd_pcm_open()
or
snd_pcm_open_preferred().
- buffer
- A pointer to a buffer that holds the data to be written.
- size
- The amount of data to write, in bytes.
libasound.so
The snd_pcm_write() function
writes samples to the device, which must be in the proper format specified by
snd_pcm_channel_prepare()
or
snd_pcm_playback_prepare().
This function may suspend a process if blocking mode is active (see
snd_pcm_nonblock_mode()).
and no space is available in the device's buffers.
When the subdevice is in blocking mode (SND_PCM_MODE_BLOCK),
then the number of written bytes must fulfill the
N × fragment-size expression,
where N > 0.
If the stream format is noninterleaved
(the interleave member of the
snd_pcm_format_t
structure isn't set),
then the driver expects that data in one fragment is separated to single voice blocks.
For example, imagine that you have two voices, and the fragment size is 512
bytes.
The number of bytes per one voice is 256. The driver
expects that the first 256 bytes contain samples for the first voice and
the second 256 bytes from fragment contain samples for the second voice.
A positive value that represents the number of bytes that were successfully
written to the device if the playback was successful, or an error value if an
error occurred.
- -EAGAIN
- Try again later. The subchannel is opened nonblock.
- -EINVAL
- One of the following:
- The handle is invalid.
- The buffer argument is NULL, but the
size is greater than zero.
- The size is negative.
- -EIO
- One of:
- The channel isn't in the prepared or running state.
- In SND_PCM_MODE_BLOCK mode, the size isn't
an even multiple of the frag_size member of the
snd_pcm_channel_setup_t
structure.
- -EWOULDBLOCK
- The write would have blocked (nonblocking write).
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
snd_pcm_channel_prepare(),
snd_pcm_playback_prepare(),
snd_pcm_plugin_write()
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_write.html on line 194
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_write.html on line 194