blip  0.1
WAVAudioDecoder Class Reference

An AudioDecoder for WAV audio clips. More...

#include <WAVAudioDecoder.hpp>

Inheritance diagram for WAVAudioDecoder:

Public Member Functions

 WAVAudioDecoder (ccxx::DataReader *reader)
 Construct a new WAVAudioDecoder that will read a WAV audio clip from the given DataReader. More...
 
virtual ~WAVAudioDecoder ()
 Destructor. More...
 
void decodeMetadata ()
 Decode the metadata for the audio clip. More...
 
void decodeAudio (AudioClip *audio)
 Decode the audio clip itself. More...
 
const AudioFormatgetAudioFormat () const
 Get the audio format. More...
 
uint32_t getNumSamples () const
 Get the number of PCM samples in the audio data. More...
 

Protected Member Functions

virtual void readMetadata (ccxx::DataReader *reader)
 This method must be implemented to perform the audio metadata decoding. More...
 
virtual void readAudio (ccxx::DataReader *reader, AudioClip *audio)
 This method must be implemented to perform the audio data decoding. More...
 
void setAudioFormat (const AudioFormat &format)
 This method should be called from readMetadata() to store the audio format information, once it has been determined. More...
 
void setNumSamples (uint32_t numSamples)
 This method should be called from readMetadata() to store the number of PCM samples, once it has been determined. More...
 

Detailed Description

An AudioDecoder for WAV audio clips.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ WAVAudioDecoder()

WAVAudioDecoder ( ccxx::DataReader *  reader)

Construct a new WAVAudioDecoder that will read a WAV audio clip from the given DataReader.

◆ ~WAVAudioDecoder()

~WAVAudioDecoder ( )
virtual

Destructor.

Member Function Documentation

◆ decodeAudio()

void decodeAudio ( AudioClip audio)
inherited

Decode the audio clip itself.

This method must be called after decodeMetadata().

Parameters
audioThe AudioClip in which to store the image data.
Exceptions
IOExceptionIf an I/O error occurs, or if the supplied AudioClip is too small to accommodate the audio data.

◆ decodeMetadata()

void decodeMetadata ( )
inherited

Decode the metadata for the audio clip.

This method must be called before decodeAudio().

Exceptions
IOExceptionIf an I/O error occurs.

◆ getAudioFormat()

const AudioFormat& getAudioFormat ( ) const
inlineinherited

Get the audio format.

This method will return an invalid AudioFormat if decodeMetadata() has not yet been called.

◆ getNumSamples()

uint32_t getNumSamples ( ) const
inlineinherited

Get the number of PCM samples in the audio data.

This method will return 0 if decodeMetadata() has not yet been called.

◆ readAudio()

void readAudio ( ccxx::DataReader *  reader,
AudioClip audio 
)
protectedvirtual

This method must be implemented to perform the audio data decoding.

Parameters
readerThe DataReader that the audio clip is being read from.
audioThe AudioClip to store the audio data into.
Exceptions
IOExceptionIf an I/O error occurs.

Implements AudioDecoder.

◆ readMetadata()

void readMetadata ( ccxx::DataReader *  reader)
protectedvirtual

This method must be implemented to perform the audio metadata decoding.

Parameters
readerThe DataReader that the audio clip is being read from.
Exceptions
IOExceptionIf an I/O error occurs.

Implements AudioDecoder.

◆ setAudioFormat()

void setAudioFormat ( const AudioFormat format)
inlineprotectedinherited

This method should be called from readMetadata() to store the audio format information, once it has been determined.

◆ setNumSamples()

void setNumSamples ( uint32_t  numSamples)
inlineprotectedinherited

This method should be called from readMetadata() to store the number of PCM samples, once it has been determined.


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