Skip to content

SoundFormat

struct SoundFormat

Describe the format of an audio sample.

This data structure is mainly filled by a Codec during the initialization time.

Functions

Name Description
SetAll Sets all the properties of the sound format.
GetSampleRate Get the sample rate.
GetNumChannels Get the number of channels.
GetBitsPerSample Get the bits per sample.
GetFramesCount Get the number of frames.
GetFrameSize Get the frame size.
GetSampleType Get the sample type.

Function Details

GetBitsPerSample

[[nodiscard]] inline AmUInt32 GetBitsPerSample() const

Get the bits per sample.

Return
The number of bits per sample.

GetFrameSize

[[nodiscard]] inline AmUInt32 GetFrameSize() const

Get the frame size.

Return
The size of each audio frame in bytes.

GetFramesCount

[[nodiscard]] inline AmUInt64 GetFramesCount() const

Get the number of frames.

Return
The total number of audio frames.

GetNumChannels

[[nodiscard]] inline AmUInt16 GetNumChannels() const

Get the number of channels.

Return
The number of audio channels.

GetSampleRate

[[nodiscard]] inline AmUInt32 GetSampleRate() const

Get the sample rate.

Return
The sample rate of the audio.

GetSampleType

[[nodiscard]] inline eAudioSampleFormat GetSampleType() const

Get the sample type.

Return
The type of audio sample.

SetAll

void SetAll( AmUInt32 sampleRate, AmUInt16 numChannels, AmUInt32 bitsPerSample, AmUInt64 framesCount, AmUInt32 frameSize, eAudioSampleFormat sampleType)

Sets all the properties of the sound format.

Parameter sampleRate
The sample rate of the audio.
Parameter numChannels
The number of audio channels.
Parameter bitsPerSample
The number of bits per sample.
Parameter framesCount
The total number of audio frames.
Parameter frameSize
The size of each audio frame in bytes.
Parameter sampleType
The type of audio sample.