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

An opaque object that represents an audio decoder. More...

Inheritance diagram for SDL::AudioDecoder:
Inheritance graph
[legend]

Public Member Functions

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 AudioDecoderoperator= (AudioDecoder &&other) noexcept
 Assignment operator.
 
AudioDecoderoperator= (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...
 

Detailed Description

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.

These objects are created with CreateAudioDecoder() or CreateAudioDecoder_IO(), and then can use AudioDecoder.DecodeAudio() to retrieve the raw PCM data.

Since
This struct is available since SDL_mixer 3.0.0.
Category:
Resource

Constructor & Destructor Documentation

◆ AudioDecoder()

constexpr SDL::AudioDecoder::AudioDecoder ( AudioDecoderRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea AudioDecoderRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.


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