Inherits from: MTBuffer
An MTAudioBuffer is a thread-safe, flow-controlled, fixed-size audio sample buffer. It is a concrete subclass of MTBuffer where each abstract frame is one audio frame, consisting of one or more channels of Float32 samples. It is intended to be used as a producer/consumer conduit for Core Audio's audio samples where each of producer and consumer may be batch-oriented or time-constrained. It can copy frames to and from AudioBufferLists that have any number of streams and any number of interleaved channels per stream, including one channel per stream, which is the canonical de-interleaved format.
- (unsigned) capacity
- (unsigned) channels
- (unsigned) count
- (void) flush
- (id) init
- (id) initWithCapacityFrames:(unsigned)frames channels:(unsigned)channels
- (Float64) rateScalar
- (unsigned) readToAudioBufferList:(AudioBufferList *)theABL maxFrames:(unsigned)count waitForData:(Boolean)wait
NO
,
then that number is further limited to the number of frames currently on hand in the buffer.
If wait is YES
and the receiver has not been
closed, then this method will pause if necessary until enough data
has been written into the receiver by
writeFromAudioBufferList:maxFrames:rateScalar:waitForRoom:
to supply the request.
If theABL has fewer channels than the receiver, then excess channels in the copied frames are discarded. If theABL
has more channels than the receiver, then the excess channels are cleared to silence.
scaledCount is decreased by the number of frames copied, scaled by rateScalar.
- (Float64) scaledCount
- (unsigned) writeFromAudioBufferList:(const AudioBufferList *)theABL maxFrames:(unsigned)count rateScalar:(Float64)rateScalar waitForRoom:(Boolean)wait
NO
,
then that number is further restricted to the amount of currently unused space in the receiver, and that many frames
are copied immediately. If wait is YES
and the receiver has not been
closed, then this method will pause if necessary until enough
room has been made by
readToAudioBufferList:maxFrames:waitForData:
to accommodate the request. If theABL has fewer channels than the receiver, then the excess channels of the receiver
are filled with silence. If theABL has more channels than the receiver, then excess channels of theABL are
discarded.
scaledCount is increased by the product of rateScalar and the number of frames copied.