CrystalSpace

Public API Reference

iSoundSource Struct Reference

The sound source is an instance of a sound. More...

#include <isound/source.h>

Inheritance diagram for iSoundSource:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual float GetFrequencyFactor ()=0
 Get frequency factor.
virtual float GetMaximumDistance ()=0
 Retrieve the maximum distance for which a sound can be heard.
virtual float GetMinimumDistance ()=0
 Retrieve the maximum distance for which a sound is heard at full volume.
virtual int GetMode3D ()=0
 return 3d mode
virtual csVector3 GetPosition ()=0
 get position of this source
virtual csVector3 GetVelocity ()=0
 get velocity of this source
virtual float GetVolume ()=0
 Get volume (range from 0.0 to 1.0).
virtual void Play (unsigned long playMethod=0)=0
 Play the sound. PlayMethod can be set to any combination of SOUND_*.
virtual void SetFrequencyFactor (float factor)=0
 Set frequency factor : 1 = normal, >1 faster, 0-1 slower.
virtual void SetMaximumDistance (float distance)=0
 Set the greatest distance from a sound at which the sound can be heard.
virtual void SetMinimumDistance (float distance)=0
 Set the greatest distance from a sound at which the sound plays at full amplitude.
virtual void SetMode3D (int m)=0
 set 3d mode
virtual void SetPosition (csVector3 pos)=0
 set position of this source
virtual void SetVelocity (csVector3 spd)=0
 set velocity of this source
virtual void SetVolume (float volume)=0
 Set volume (range from 0.0 to 1.0).
virtual void Stop ()=0
 Stop the sound.

Detailed Description

The sound source is an instance of a sound.

It can be a non-3d source, in which case it plays the sound as it was recorded, or a 3d source, in which case it represents an object in 3d space and adjusts L/R volume for 3d sound.

Definition at line 53 of file source.h.


Member Function Documentation

virtual float iSoundSource::GetFrequencyFactor  )  [pure virtual]
 

Get frequency factor.

virtual float iSoundSource::GetMaximumDistance  )  [pure virtual]
 

Retrieve the maximum distance for which a sound can be heard.

See SetMaximumDistance and SetMinimumDistance for distance notes.

virtual float iSoundSource::GetMinimumDistance  )  [pure virtual]
 

Retrieve the maximum distance for which a sound is heard at full volume.

See SetMaximumDistance and SetMinimumDistance for distance notes.

virtual int iSoundSource::GetMode3D  )  [pure virtual]
 

return 3d mode

virtual csVector3 iSoundSource::GetPosition  )  [pure virtual]
 

get position of this source

virtual csVector3 iSoundSource::GetVelocity  )  [pure virtual]
 

get velocity of this source

virtual float iSoundSource::GetVolume  )  [pure virtual]
 

Get volume (range from 0.0 to 1.0).

virtual void iSoundSource::Play unsigned long  playMethod = 0  )  [pure virtual]
 

Play the sound. PlayMethod can be set to any combination of SOUND_*.

virtual void iSoundSource::SetFrequencyFactor float  factor  )  [pure virtual]
 

Set frequency factor : 1 = normal, >1 faster, 0-1 slower.

virtual void iSoundSource::SetMaximumDistance float  distance  )  [pure virtual]
 

Set the greatest distance from a sound at which the sound can be heard.

If the distance to a listener is above this threshold, it will not be mixed into the output buffer at all. This saves a tiny bit of processing.

virtual void iSoundSource::SetMinimumDistance float  distance  )  [pure virtual]
 

Set the greatest distance from a sound at which the sound plays at full amplitude.

When a listener is closer than this distance, the amplitude is the volume of the sound. When a listener is further than this distance, the amplitude follows the formula V = (volume / ((distance/minimum_distance) ^ rolloff_factor))

virtual void iSoundSource::SetMode3D int  m  )  [pure virtual]
 

set 3d mode

virtual void iSoundSource::SetPosition csVector3  pos  )  [pure virtual]
 

set position of this source

virtual void iSoundSource::SetVelocity csVector3  spd  )  [pure virtual]
 

set velocity of this source

virtual void iSoundSource::SetVolume float  volume  )  [pure virtual]
 

Set volume (range from 0.0 to 1.0).

virtual void iSoundSource::Stop  )  [pure virtual]
 

Stop the sound.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.4.6