1 #ifndef __blip_AudioDecoder_hpp 2 #define __blip_AudioDecoder_hpp 7 #include <commonc++/DataReader.h++> 66 {
return(_numSamples); }
96 { _numSamples = numSamples; }
100 ccxx::DataReader* _reader;
102 uint32_t _numSamples;
111 #endif // __blip_AudioDecoder_hpp An abstract base class for audio decoders.
Definition: AudioDecoder.hpp:28
virtual void readAudio(ccxx::DataReader *reader, AudioClip *audio)=0
This method must be implemented to perform the audio data decoding.
void setNumSamples(uint32_t numSamples)
This method should be called from readMetadata() to store the number of PCM samples, once it has been determined.
Definition: AudioDecoder.hpp:95
uint32_t getNumSamples() const
Get the number of PCM samples in the audio data.
Definition: AudioDecoder.hpp:65
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
void decodeMetadata()
Decode the metadata for the audio clip.
Definition: AudioDecoder.cpp:31
AudioDecoder(ccxx::DataReader *reader)
Construct a new AudioDecoder that will read an image from the given DataReader.
Definition: AudioDecoder.cpp:13
virtual void readMetadata(ccxx::DataReader *reader)=0
This method must be implemented to perform the audio metadata decoding.
void decodeAudio(AudioClip *audio)
Decode the audio clip itself.
Definition: AudioDecoder.cpp:43
virtual ~AudioDecoder()
Destructor.
Definition: AudioDecoder.cpp:24
const AudioFormat & getAudioFormat() const
Get the audio format.
Definition: AudioDecoder.hpp:59
A container for audio data.
Definition: AudioClip.hpp:13
void setAudioFormat(const AudioFormat &format)
This method should be called from readMetadata() to store the audio format information, once it has been determined.
Definition: AudioDecoder.hpp:89