0c3df1d430
Added a raw audio decoder, allowing raw audio to be played if the format and frequency is known. Will also load from .raw files on disk, but will assume the format is 16 bit mono and the frequency is 22050 hz Added a tutorial to show how recording and playback can be done. Added the ability for the user to unregister audio codecs that they will not be using. Also added methods to test for the existance of a decoder and get the decoder factory back. Moved cVector3.h to include instead of Headers to make using it in user projects easier (one less include path) Moved the audio format enum to its own header file. Small fix in the wav decoder to prevent the file header from being played as audio data.
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#ifndef CRAWDECODER_H_INCLUDED
|
|
#define CRAWDECODER_H_INCLUDED
|
|
|
|
#include "../include/IAudioDecoder.h"
|
|
|
|
namespace cAudio
|
|
{
|
|
|
|
class cRawDecoder : public IAudioDecoder
|
|
{
|
|
public:
|
|
|
|
cRawDecoder(IDataSource* stream, unsigned int frequency, AudioFormats format);
|
|
~cRawDecoder();
|
|
|
|
//!Retruns the format of the audio data
|
|
virtual AudioFormats getFormat();
|
|
|
|
//!Returns the frequency of the audio data
|
|
virtual int getFrequency();
|
|
|
|
//!Returns whether seeking is supported
|
|
virtual bool isSeekingSupported();
|
|
|
|
//!Reads a section of data out of the audio stream
|
|
virtual int readAudioData(void* output, int amount);
|
|
|
|
//!Sets the position to read data out of
|
|
virtual bool setPosition(int position, bool relative);
|
|
|
|
//!If seeking is supported, will seek the stream to seconds
|
|
virtual bool seek(float seconds,bool relative);
|
|
|
|
private:
|
|
unsigned int Frequency;
|
|
AudioFormats Format;
|
|
};
|
|
|
|
}
|
|
|
|
#endif //! CRAWDECODER_H_INCLUDED
|