SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::AudioFormat Class Reference

Audio format. More...

Public Member Functions

constexpr AudioFormat (AudioFormatRaw audioFormat={})
 Wraps AudioFormat. More...
 
constexpr AudioFormat (bool sign, bool bigendian, bool flt, Uint16 size)
 Define an AudioFormat value. More...
 
constexpr operator AudioFormatRaw () const
 Unwraps to the underlying AudioFormat. More...
 
constexpr Uint16 GetBitSize () const
 Retrieve the size, in bits, from an AudioFormat. More...
 
constexpr Uint16 GetByteSize () const
 Retrieve the size, in bytes, from an AudioFormat. More...
 
constexpr bool IsFloat () const
 Determine if an AudioFormat represents floating point data. More...
 
constexpr bool IsBigEndian () const
 Determine if an AudioFormat represents bigendian data. More...
 
constexpr bool IsLittleEndian () const
 Determine if an AudioFormat represents littleendian data. More...
 
constexpr bool IsSigned () const
 Determine if an AudioFormat represents signed data. More...
 
constexpr bool IsInt () const
 Determine if an AudioFormat represents integer data. More...
 
constexpr bool IsUnsigned () const
 Determine if an AudioFormat represents unsigned data. More...
 
const char * GetName () const
 Get the human readable name of an audio format. More...
 
int GetSilenceValue () const
 Get the appropriate memset value for silencing an audio format. More...
 

Detailed Description

Since
This enum is available since SDL 3.2.0.
See also
AudioFormat.GetBitSize
AudioFormat.GetByteSize
AudioFormat.IsInt
AudioFormat.IsFloat
AudioFormat.IsBigEndian
AudioFormat.IsLittleEndian
AudioFormat.IsSigned
AudioFormat.IsUnsigned

Constructor & Destructor Documentation

◆ AudioFormat() [1/2]

constexpr SDL::AudioFormat::AudioFormat ( AudioFormatRaw  audioFormat = {})
inlineconstexpr
Parameters
audioFormatthe value to be wrapped

◆ AudioFormat() [2/2]

constexpr SDL::AudioFormat::AudioFormat ( bool  sign,
bool  bigendian,
bool  flt,
Uint16  size 
)
inlineconstexpr

SDL does not support custom audio formats, so this macro is not of much use externally, but it can be illustrative as to what the various bits of an AudioFormat mean.

For example, AUDIO_S32LE looks like this:

Audio format.
Definition: SDL3pp_audio.h:261
constexpr AudioFormat(AudioFormatRaw audioFormat={})
Wraps AudioFormat.
Definition: SDL3pp_audio.h:270
Parameters
sign1 for signed data, 0 for unsigned data.
bigendian1 for bigendian data, 0 for littleendian data.
flt1 for floating point data, 0 for integer data.
sizenumber of bits per sample.
Postcondition
a format value in the style of AudioFormat.
Thread safety:
It is safe to call this macro from any thread.
Since
This macro is available since SDL 3.2.0.

Member Function Documentation

◆ operator AudioFormatRaw()

constexpr SDL::AudioFormat::operator AudioFormatRaw ( ) const
inlineconstexpr
Returns
the underlying AudioFormatRaw.

The documentation for this class was generated from the following file: