SFXFormat

Engine/source/sfx/sfxCommon.h

This class defines the various types of sound data that may be used in the sound system.

More...

Protected Attributes

The number of bits per sound sample.

The number of sound channels in the data.

The frequency in samples per second.

Public Functions

Copy constructor.

SFXFormat(U8 channels, U8 bitsPerSample, U32 samplesPerSecond)

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.

Returns the data length in bytes.

getDuration(U32 samples)

Returns the duration from the sample count.

bool

Returns true if there is a single sound channel.

bool

Is true if there are more than two sound channels.

bool

Is true if there are two sound channels.

bool

Comparision between formats.

set(U8 channels, U8 bitsPerSample, U32 samplesPerSecond)

Sets the format.

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.