Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

AudioFormat_MOD Class Reference
[Audio]

Inheritance diagram for AudioFormat_MOD:

AudioFormat

List of all members.


Public Member Functions

 AudioFormat_MOD (const Asset &asset)
virtual ~AudioFormat_MOD ()
virtual int GetChannels ()
virtual int GetFrequency ()
virtual int GetBitsPerSample ()
virtual int GetSize ()
virtual int GetPosition ()
virtual void SetPosition (int position)
virtual int CopySoundChunk (void *buffer, int bytes)

Static Public Member Functions

static void Register ()
static bool TestAsset (const Asset &asset)
static AudioFormatCreate (const Asset &asset)

Detailed Description

Author:
Mattias Gustavsson

Definition at line 21 of file AudioFormat_MOD.h.


Constructor & Destructor Documentation

AudioFormat_MOD::AudioFormat_MOD ( const Asset asset  ) 

Constructor

Definition at line 55 of file AudioFormat_MOD.cpp.

AudioFormat_MOD::~AudioFormat_MOD (  )  [virtual]

Destructor

Definition at line 90 of file AudioFormat_MOD.cpp.


Member Function Documentation

void AudioFormat_MOD::Register (  )  [static]

Definition at line 13 of file AudioFormat_MOD.cpp.

bool AudioFormat_MOD::TestAsset ( const Asset asset  )  [static]

Definition at line 29 of file AudioFormat_MOD.cpp.

AudioFormat * AudioFormat_MOD::Create ( const Asset asset  )  [static]

Definition at line 21 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::GetChannels (  )  [virtual]

Returns the number of channels this audio data is using 1=mono, 2=stereo

Implements AudioFormat.

Definition at line 101 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::GetFrequency (  )  [virtual]

Returns the frequency of the audio data in number of samples per second

Implements AudioFormat.

Definition at line 109 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::GetBitsPerSample (  )  [virtual]

Returns the number of bits per sample, normally 8 or 16

Implements AudioFormat.

Definition at line 117 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::GetSize (  )  [virtual]

Returns the total size (in bytes) of the raw audio data. To calculate the length of the data in seconds, use this: float length=((float)GetSize())/(float)(GetChannels()*GetFrequency()*GetBitsPerSample())

Implements AudioFormat.

Definition at line 125 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::GetPosition (  )  [virtual]

Returns the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data. To convert this position to second, use the same formula as described for GetSize

Implements AudioFormat.

Definition at line 137 of file AudioFormat_MOD.cpp.

void AudioFormat_MOD::SetPosition ( int  position  )  [virtual]

Sets the current position (in bytes) in the raw audio data stream, meaning the position from which the next call to CopySoundChunk will start outputting data.

Parameters:
position Position in bytes from the start

Implements AudioFormat.

Definition at line 145 of file AudioFormat_MOD.cpp.

int AudioFormat_MOD::CopySoundChunk ( void *  buffer,
int  bytes 
) [virtual]

Copy a chunk of the raw audio data to the specified memory buffer. The requested number of bytes will be written to the buffer, unless the end of the audio data is reached. The total number of bytes written is always returned.

Parameters:
buffer Buffer to write data to. Must be large enough to hold the requested number of bytes
bytes Number of bytes to write. The actual number of bytes written may be less than this if the end of the data is reached.

Implements AudioFormat.

Definition at line 159 of file AudioFormat_MOD.cpp.



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.