100 bool setup(
unsigned char* a_data,
const unsigned int a_size,
int a_frequency,
bool a_stereo,
unsigned short a_bitsPerSample);
Implements general math utility functions.
bool m_stereo
Audio data format (stereo = true, mono = false).
Definition: CAudioBuffer.h:174
bool checkError()
This methods checks for any OpenAL errors.
Definition: CAudioBuffer.cpp:545
virtual ~cAudioBuffer()
Destructor of cAudioBuffer.
Definition: CAudioBuffer.cpp:90
short getSampleRight(const double a_time, const bool a_loop)
This method returns the current sample on the right channel.
Definition: CAudioBuffer.cpp:480
std::string getFilename() const
This method returns the filename from which this audio data was most recently loaded.
Definition: CAudioBuffer.h:106
int m_frequency
Audio data frequency.
Definition: CAudioBuffer.h:171
int m_size
Audio buffer size in bytes.
Definition: CAudioBuffer.h:168
This class implements an audio buffer.
Definition: CAudioBuffer.h:78
int getFrequency()
This method returns the sampling frequency of the audio data.
Definition: CAudioBuffer.h:118
int getSize()
This method returns the size in bytes of the audio data.
Definition: CAudioBuffer.h:112
bool loadFromFile(const std::string &a_filename)
This method loads an audio file by passing the filename as argument.
Definition: CAudioBuffer.cpp:187
bool getStereo()
This method returns true if the audio data in in stereo format, otherwise false.
Definition: CAudioBuffer.h:121
cAudioBuffer()
Constructor of cAudioBuffer.
Definition: CAudioBuffer.cpp:64
unsigned int m_buffer
OpenAL buffer ID.
Definition: CAudioBuffer.h:165
bool setup(unsigned char *a_data, const unsigned int a_size, int a_frequency, bool a_stereo, unsigned short a_bitsPerSample)
This method sets a buffer by passing a pointer to the audio data and defines the data specifications...
Definition: CAudioBuffer.cpp:117
unsigned char * getData()
This method returns a pointer to the audio data.
Definition: CAudioBuffer.h:127
unsigned int getBuffer()
This method returns the OpenAL buffer ID.
Definition: CAudioBuffer.h:109
unsigned short m_bitsPerSample
Audio data resolution. Number of bits per sample (8 or 16).
Definition: CAudioBuffer.h:177
unsigned char * m_data
Audio data.
Definition: CAudioBuffer.h:162
bool m_flagDeleteData
Audio data ownership flag.
Definition: CAudioBuffer.h:180
Definition: CAudioBuffer.cpp:56
bool cleanup()
This method clears all memory.
Definition: CAudioBuffer.cpp:338
bool convertToMono()
This method converts a stereo stream to mono.
Definition: CAudioBuffer.cpp:273
short getSampleLeft(const double a_time, const bool a_loop)
This method returns the current sample on the left channel.
Definition: CAudioBuffer.cpp:410
int getBitsPerSample()
This method returns the sample format of the audio data.
Definition: CAudioBuffer.h:124
int getNumSamples()
This method returns the number of samples that compose the audio data.
Definition: CAudioBuffer.cpp:367
std::string m_filename
Audio filename.
Definition: CAudioBuffer.h:159