alZeroFrames(3dm) alZeroFrames(3dm)
alZeroFrames - write zero-valued sample frames to an audio port
#include <dmedia/audio.h>
int alZeroFrames(const ALport port, const int framecount)
port is the audio output port to which you want to write samples.
This is the returned value of an alOpenPort(3dm) call.
framecount is the number of sample frames that you want to write to the
audio port.
alZeroFrames writes a given number of zero-valued sample frames to the
specified audio port. alZeroFrames blocks until framecount sample frames
have been written to the port. If you do not wish to block, make sure
that framecount is less than the return value of alGetFillable(3dm).
alZeroFrames is a convenience function, equivalent to calling
alWriteFrames(3dm) with a zero-valued buffer of the given size. However,
alZeroFrames is simpler, particularly when framecount is large; it avoids
having to allocate a large buffer or iterate over many writes of a
smaller buffer. It is also more efficient than the equivalent
alWriteFrames call.
Note that since an audio port contains an internal queue, zero-valued
frames written to the port will not immediately come out the associated
audio device or devices. alGetFilled(3dm) will indicate how many samples
are currently in this queue. Also, alGetFrameTime(3dm) and
alGetFrameNumber(3dm) provide facilities for precise synchronization of
audio and other media.
In order to achieve the best possible performance, alZeroFrames does not
attempt to verify that port or samples are valid. You should make certain
these values are valid before passing them as arguments to alZeroFrames.
alZeroFrames always returns 0.
alOpenPort(3dm), alGetFillable(3dm), alGetFilled(3dm),
alSetChannels(3dm), alSetWidth(3dm), alReadFrames(3dm),
alZeroFrames(3dm), alSetConfig(3dm), alSetQueueSize(3dm),
alSetSampFmt(3dm), alSetFloatMax(3dm)
PPPPaaaaggggeeee 1111 [ Back ]
|