|
SDL3pp
A slim C++ wrapper for SDL3
|
Reference for AudioDecoder. More...


Public Member Functions | |
| constexpr | AudioDecoderRef (AudioDecoderRaw resource) noexcept |
| Constructs from raw AudioDecoder. More... | |
| constexpr | AudioDecoderRef (const AudioDecoder &resource) noexcept |
| Constructs from AudioDecoder. More... | |
| constexpr | AudioDecoderRef (AudioDecoder &&resource) noexcept |
| Constructs from AudioDecoder. More... | |
| constexpr | AudioDecoderRef (const AudioDecoderRef &other) noexcept |
| Copy constructor. | |
| constexpr | AudioDecoderRef (AudioDecoderRef &&other) noexcept |
| Move constructor. | |
| ~AudioDecoderRef () | |
| Destructor. | |
| AudioDecoderRef & | operator= (const AudioDecoderRef &other) noexcept |
| Assignment operator. | |
| constexpr | operator AudioDecoderRaw () const noexcept |
| Converts to AudioDecoderRaw. | |
| constexpr | AudioDecoder (std::nullptr_t=nullptr) noexcept |
| Default ctor. | |
| constexpr | AudioDecoder (AudioDecoderRaw resource) noexcept |
| Constructs from raw AudioDecoder. More... | |
| constexpr | AudioDecoder (const AudioDecoder &other) noexcept=delete |
| Copy constructor. | |
| constexpr | AudioDecoder (AudioDecoder &&other) noexcept |
| Move constructor. | |
| constexpr | AudioDecoder (const AudioDecoderRef &other)=delete |
| constexpr | AudioDecoder (AudioDecoderRef &&other)=delete |
| AudioDecoder (StringParam path, PropertiesRef props=nullptr) | |
| Create a AudioDecoder from a path on the filesystem. More... | |
| AudioDecoder (IOStreamRef io, bool closeio=false, PropertiesRef props=nullptr) | |
| Create a AudioDecoder from an IOStream. More... | |
Public Member Functions inherited from SDL::AudioDecoder | |
| constexpr | AudioDecoder (std::nullptr_t=nullptr) noexcept |
| Default ctor. | |
| constexpr | AudioDecoder (AudioDecoderRaw resource) noexcept |
| Constructs from raw AudioDecoder. More... | |
| constexpr | AudioDecoder (const AudioDecoder &other) noexcept=delete |
| Copy constructor. | |
| constexpr | AudioDecoder (AudioDecoder &&other) noexcept |
| Move constructor. | |
| constexpr | AudioDecoder (const AudioDecoderRef &other)=delete |
| constexpr | AudioDecoder (AudioDecoderRef &&other)=delete |
| AudioDecoder (StringParam path, PropertiesRef props=nullptr) | |
| Create a AudioDecoder from a path on the filesystem. More... | |
| AudioDecoder (IOStreamRef io, bool closeio=false, PropertiesRef props=nullptr) | |
| Create a AudioDecoder from an IOStream. More... | |
| ~AudioDecoder () | |
| Destructor. | |
| constexpr AudioDecoder & | operator= (AudioDecoder &&other) noexcept |
| Assignment operator. | |
| AudioDecoder & | operator= (const AudioDecoder &other)=delete |
| Assignment operator. | |
| constexpr AudioDecoderRaw | get () const noexcept |
| Retrieves underlying AudioDecoderRaw. | |
| constexpr AudioDecoderRaw | release () noexcept |
| Retrieves underlying AudioDecoderRaw and clear this. | |
| constexpr auto | operator<=> (const AudioDecoder &other) const noexcept=default |
| Comparison. | |
| constexpr | operator bool () const noexcept |
| Converts to bool. | |
| void | Destroy () |
| Destroy the specified audio decoder. More... | |
| PropertiesRef | GetProperties () |
| Get the properties associated with a AudioDecoder. More... | |
| void | GetFormat (AudioSpec *spec) |
| Query the initial audio format of a AudioDecoder. More... | |
| int | DecodeAudio (TargetBytes buffer, const AudioSpec &spec) |
| Decode more audio from a AudioDecoder. More... | |
This does not take ownership!
|
inlineconstexprnoexcept |
| resource | a AudioDecoderRaw. |
This does not takes ownership!
|
inlineconstexprnoexcept |
| resource | a AudioDecoder. |
This does not takes ownership!
|
inlineconstexprnoexcept |
| resource | a AudioDecoder. |
This will release the ownership from resource!
|
inlineexplicitconstexprnoexcept |
| resource | a AudioDecoderRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
|
inline |
Most apps won't need this, as SDL_mixer's usual interfaces will decode audio as needed. However, if one wants to decode an audio file into a memory buffer without playing it, this interface offers that.
This function allows properties to be specified. This is intended to supply file-specific settings, such as where to find SoundFonts for a MIDI file, etc. In most cases, the caller should pass a nullptr to specify no extra properties.
If closeio is true, then io will be closed when this decoder is done with it. If this function fails and closeio is true, then io will be closed before this function returns.
When done with the audio decoder, it can be destroyed with AudioDecoder.Destroy().
This function requires SDL_mixer to have been initialized with a successful call to MIX.Init(), but does not need an actual Mixer to have been created.
| io | the i/o stream from which to load data. |
| closeio | if true, close the i/o stream when done with it. |
| props | decoder-specific properties. May be nullptr. |
|
inline |
Most apps won't need this, as SDL_mixer's usual interfaces will decode audio as needed. However, if one wants to decode an audio file into a memory buffer without playing it, this interface offers that.
This function allows properties to be specified. This is intended to supply file-specific settings, such as where to find SoundFonts for a MIDI file, etc. In most cases, the caller should pass a nullptr to specify no extra properties.
Properties are discussed in SDL's documentation .
When done with the audio decoder, it can be destroyed with AudioDecoder.Destroy().
This function requires SDL_mixer to have been initialized with a successful call to MIX.Init(), but does not need an actual Mixer to have been created.
| path | the path on the filesystem from which to load data. |
| props | decoder-specific properties. May be nullptr. |