SFXFormat
This class defines the various types of sound data that may be used in the sound system.
Protected Attributes
The number of bits per sound sample.
The frequency in samples per second.
Public Functions
The bits of data per channel.
The number of bits per sound sample.
The number of bytes of data per channel.
The number of bytes of data per sample.
Returns the number of sound channels.
getDataLength(U32 ms)
Returns the data length in bytes.
getDuration(U32 samples)
Returns the duration from the sample count.
getSampleCount(U32 ms)
bool
isMono()
Returns true if there is a single sound channel.
bool
Is true if there are more than two sound channels.
bool
isStereo()
Is true if there are two sound channels.
bool
operator==(const SFXFormat & format)
Comparision between formats.
Detailed Description
This class defines the various types of sound data that may be used in the sound system.
Unlike with most sound APIs, we consider each sample point to comprise all channels in a sound stream rather than only one value for a single channel.
Protected Attributes
U8 mBitsPerSample
The number of bits per sound sample.
U8 mChannels
The number of sound channels in the data.
U32 mSamplesPerSecond
The frequency in samples per second.
Public Functions
SFXFormat(const SFXFormat & format)
Copy constructor.
SFXFormat(U8 channels, U8 bitsPerSample, U32 samplesPerSecond)
getBitsPerChannel()
The bits of data per channel.
getBitsPerSample()
The number of bits per sound sample.
getBytesPerChannel()
The number of bytes of data per channel.
getBytesPerSample()
The number of bytes of data per sample.
note:Be aware that this comprises all channels.
getChannels()
Returns the number of sound channels.
getDataLength(U32 ms)
Returns the data length in bytes.
getDuration(U32 samples)
Returns the duration from the sample count.
getSampleCount(U32 ms)
getSamplesPerSecond()
isMono()
Returns true if there is a single sound channel.
isMultiChannel()
Is true if there are more than two sound channels.
isStereo()
Is true if there are two sound channels.
operator==(const SFXFormat & format)
Comparision between formats.
set(U8 channels, U8 bitsPerSample, U32 samplesPerSecond)
Sets the format.