Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

Sound Class Reference
[Audio]

List of all members.


Public Member Functions

 Sound (const Asset &asset)
 ~Sound ()
void Play (float priority=0, bool looping=false) const
const void * GetData () const
int GetChannels () const
int GetFrequency () const
int GetBitsPerSample () const
int GetSize () const

Detailed Description

Author:
Mattias Gustavsson

Definition at line 20 of file Sound.h.


Constructor & Destructor Documentation

Sound::Sound ( const Asset asset  ) 

Constructor

Definition at line 12 of file Sound.cpp.

Sound::~Sound (  ) 

Destructor

Definition at line 35 of file Sound.cpp.


Member Function Documentation

void Sound::Play ( float  priority = 0,
bool  looping = false 
) const

Definition at line 43 of file Sound.cpp.

const void * Sound::GetData (  )  const

Definition at line 51 of file Sound.cpp.

int Sound::GetChannels (  )  const

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

Definition at line 59 of file Sound.cpp.

int Sound::GetFrequency (  )  const

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

Definition at line 67 of file Sound.cpp.

int Sound::GetBitsPerSample (  )  const

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

Definition at line 75 of file Sound.cpp.

int Sound::GetSize (  )  const

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

Definition at line 83 of file Sound.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.