cAudio  2.3.0
3d Audio Engine
cRawDecoder.h
1 // Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
2 // This file is part of the "cAudio Engine"
3 // For conditions of distribution and use, see copyright notice in cAudio.h
4 
5 #pragma once
6 
7 #include "IAudioDecoder.h"
8 #include "cMemoryOverride.h"
9 
10 namespace cAudio
11 {
12  class cRawDecoder : public IAudioDecoder, public cMemoryOverride
13  {
14  public:
15 
16  cRawDecoder(IDataSource* stream, unsigned int frequency, AudioFormats format);
17  ~cRawDecoder();
18 
19  virtual AudioFormats getFormat();
20  virtual int getFrequency();
21  virtual bool isSeekingSupported();
22  virtual bool isValid();
23  virtual int readAudioData(void* output, int amount);
24  virtual bool setPosition(int position, bool relative);
25  virtual bool seek(float seconds,bool relative);
26  virtual float getTotalTime();
27  virtual int getTotalSize();
28  virtual int getCompressedSize();
29  virtual float getCurrentTime();
30  virtual int getCurrentPosition();
31  virtual int getCurrentCompressedPosition();
32  virtual cAudioString getType() const;
33 
34  private:
35  unsigned int Frequency;
36  AudioFormats Format;
37  };
38 };
cAudio::AudioFormats
AudioFormats
Enumeration of audio formats supported by the engine.
Definition: EAudioFormats.h:11
cAudio::cRawDecoder::setPosition
virtual bool setPosition(int position, bool relative)
Sets the position in the stream to read from.
Definition: cRawDecoder.cpp:44
cAudio::cRawDecoder::isSeekingSupported
virtual bool isSeekingSupported()
Returns whether seeking is supported.
Definition: cRawDecoder.cpp:29
cAudio::cMemoryOverride
Overrides the memory allocations for classes derived from it and makes them use the cAudio memory sys...
Definition: cMemoryOverride.h:14
cAudio::IAudioDecoder
Interface for all Audio Decoders in cAudio.
Definition: IAudioDecoder.h:16
cAudio::cRawDecoder::getFormat
virtual AudioFormats getFormat()
Returns the format of the audio data.
Definition: cRawDecoder.cpp:19
cAudio
Main namespace for the entire cAudio library.
Definition: cAudioCapture.h:16
cAudio::cRawDecoder::getType
virtual cAudioString getType() const
Returns the IAudioDecoderType.
Definition: cRawDecoder.cpp:115
cAudio::cRawDecoder::getTotalTime
virtual float getTotalTime()
If seeking is supported, will return the length of the audio steam in seconds. Returns a negative num...
Definition: cRawDecoder.cpp:66
cAudio::cRawDecoder::getCurrentCompressedPosition
virtual int getCurrentCompressedPosition()
Returns the position in the compressed (original) audio stream before decoding.
Definition: cRawDecoder.cpp:110
cAudio::cRawDecoder::isValid
virtual bool isValid()
Returns whether the stream is valid for this codec.
Definition: cRawDecoder.cpp:34
cAudio::cRawDecoder::getFrequency
virtual int getFrequency()
Returns the frequency (sample rate) of the audio data.
Definition: cRawDecoder.cpp:24
cAudio::cRawDecoder::getCurrentPosition
virtual int getCurrentPosition()
If available, returns the current position in the decoded audio stream in bytes. Returns a negative n...
Definition: cRawDecoder.cpp:105
cAudio::cRawDecoder
Definition: cRawDecoder.h:13
cAudio::cRawDecoder::getTotalSize
virtual int getTotalSize()
If available, returns the total decoded size of the audio stream. Returns a negative number if this c...
Definition: cRawDecoder.cpp:80
cAudio::cRawDecoder::seek
virtual bool seek(float seconds, bool relative)
If seeking is supported, will seek the stream to seconds.
Definition: cRawDecoder.cpp:50
cAudio::cRawDecoder::getCompressedSize
virtual int getCompressedSize()
Returns the compressed (original) size of the audio stream, before decoding.
Definition: cRawDecoder.cpp:85
cAudio::IDataSource
Interface for data providers in cAudio.
Definition: IDataSource.h:13
cAudio::cRawDecoder::getCurrentTime
virtual float getCurrentTime()
If seeking is supported, will return the current position in the stream in seconds....
Definition: cRawDecoder.cpp:90
cAudio::cRawDecoder::readAudioData
virtual int readAudioData(void *output, int amount)
Reads a section of data out of the audio stream.
Definition: cRawDecoder.cpp:39