Carbon


SoundComponentData

Header: Sound.h

struct SoundComponentData {
    SInt32 flags; 
    OSType format; 
    SInt16 numChannels; 
    SInt16 sampleSize; 
    UnsignedFixed sampleRate; 
    SInt32 sampleCount; 
    Byte *buffer; 
    SInt32 reserved;
};
typedef SoundComponentData SoundComponentDataPtr;

Field descriptions

flags

A set of bit flags whose meanings are specific to a particular sound component.

format

The format of the data a sound component is producing.

See “Audio Data Types” for a description of these formats. You can define additional format types, which are currently assumed to be the types of proprietary compression algorithms.

numChannels

The number of channels of sound in the output data stream. If this field contains the value 1, the data is monophonic. If this field contains 2, the data is stereophonic. Stereo data is stored as interleaved samples, in a left-to-right ordering.

sampleSize

The size, in bits, of each sample in the output data stream. Typically this field contains the values 8 or 16. For compressed sound data, this field indicates the size of the samples after the data has been expanded.

sampleRate

The sample rate for the audio data. The sample rate is expressed as an unsigned, fixed-point number in the range 0 to 65536.0 samples per second.

sampleCount

The number of samples in the buffer pointed to by the buffer field. For compressed sounds, this field indicates the number of compressed samples in the sound, not the size of the buffer.

buffer

The location of the buffer that contains the sound data.

reserved

Reserved for future use. You should set this field to 0.

The flow of data from one sound component to another is managed using a sound component data structure. This structure indicates to other sound components the format of the data that a particular component is generating, together with the location and length of the buffer containing that data. This allows other sound components to access data from that component as needed. A sound component data structure is defined by the SoundComponentData data type.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)