CSoundModule Class Reference

The sound module class. This is the sound system of the OPSIMUS application. More...

#include <SoundModule.h>

Inheritance diagram for CSoundModule:

CModule_Conn CModule CSingleton

List of all members.

Public Member Functions

void Init ()
 Initializes the sound module.
void SetID (const char *id)
 Sets the unique sound module id among network.
void SendToID (const char *id)
 Starts sending voice data to a sound module.
void PlayFromID (const char *id)
 Starts playing voice data coming from a sound module.
void CancelSend (const char *id)
 Stops sending voice data to a sound module.
void CancelPlay (const char *id)
 Stops playing voice data coming from a sound module.
void CancelAllSend ()
 Cancels all sending voice.
void CancelAllPlay ()
 Cancels all playing voice.
void Iterate ()
 Call at regular intervals to ensure proper working.
void Destroy ()
 Destroys the sound module.
CWavPlayerCreateWavPlayer (const char *filename)
C3DWavPlayerCreate3DWavPlayer (const char *filename)
void DestroyWavPlayer (CWavPlayer *wp)
void PlayWav (const char *filename)
void Play3DWav (const char *filename, const float *pos, float attn=DEFAULT_ATTENUATION, float attndist=DEFAULT_ATTENUATIONDISTANCE)
virtual void ReceivePacket (CPacket *packet)
 ech derived clas must implement its own receive package policy
void SetVoiceVolume (float v)
float GetVoiceVolume ()
 Returns the volume for voice communication sounds.
void SetWavPlayerVolume (float v)
float GetWavPlayerVolume ()
 Returns the volume for wav players. (CWavPlayer,C3DWavPlayer,PlayWav).
void SetListenerPosition (const float *pos)
void SetListenerDirection (const float *at, const float *up)
void SetListenerVelocity (const float *vel)
void SetSpeedOfSound (float speed)

Static Public Member Functions

static CSoundModuleGetInstance ()
 sub classes should implement this for easy access to self (which is a singleton)

Protected Attributes

string ID
 Holds the sound module ID.
CEncodedVoiceRecorder evr
 The voice recorder.
set< string > sendlist
 The list of IDs that the recorded data is sent to.
map< string, CEncodedVoicePlayerplaylist
 The list of IDs and associated voice players that incoming voice data is played.
string record_options
 The sound options string for recording. Refer to the design report.


Detailed Description

The sound module class. This is the sound system of the OPSIMUS application.

Member Function Documentation

CWavPlayer* CSoundModule::CreateWavPlayer ( const char *  filename  ) 

Creates a Wav Player.

Parameters:
filename The name of the wave file.
Returns:
The newly created wav player instance.

C3DWavPlayer* CSoundModule::Create3DWavPlayer ( const char *  filename  ) 

Creates a 3D Wav Player.

Parameters:
filename The name of the wave file.
Returns:
The newly created 3d wav player instance.

void CSoundModule::DestroyWavPlayer ( CWavPlayer wp  ) 

Destroys a Wav Player

Parameters:
wp The wav player or 3d wav player to be destroyed.

void CSoundModule::PlayWav ( const char *  filename  ) 

Plays a Wav file.

Parameters:
filename The name of the wav file.

void CSoundModule::Play3DWav ( const char *  filename,
const float *  pos,
float  attn = DEFAULT_ATTENUATION,
float  attndist = DEFAULT_ATTENUATIONDISTANCE 
)

Plays a wav in the 3D environment.

Parameters:
filename The name of the wav file.
pos An array of 3 floats describing the position to play the wav in the world.
attn Attenuation(diminishing) value.
attndist Attenuation distance value.

void CSoundModule::SetVoiceVolume ( float  v  ) 

Sets the volume for voice communication sounds.

Parameters:
v The volume amount to be set. Should be between 0.0 and 1.0 inclusively.

void CSoundModule::SetWavPlayerVolume ( float  v  ) 

Sets the volume for wav players. (CWavPlayer,C3DWavPlayer,PlayWav)

Parameters:
v The volume amount to be set. Should be between 0.0 and 1.0 inclusively.

void CSoundModule::SetListenerPosition ( const float *  pos  ) 

Sets the position of the listener for C3DWavPlayer instances.

Parameters:
pos An array of 3 floats describing the position.

void CSoundModule::SetListenerDirection ( const float *  at,
const float *  up 
)

Sets the direction of the listener for C3DWavPlayer instances.

Parameters:
at An array of 3 floats describing a vector which denotes the looking direction.
at An array of 3 floats describing a vector which denotes the up direction of the listener. Up and At parameters should be perpendicular.

void CSoundModule::SetListenerVelocity ( const float *  vel  ) 

Sets the velocity of the listener for C3DWavPlayer instances.

Parameters:
vel An array of 3 floats describing a vector which denotes the velocity.

void CSoundModule::SetSpeedOfSound ( float  speed  ) 

Sets the speed of sound for use of Doppler effect.

Parameters:
speed A float denoting the speed of sound.


The documentation for this class was generated from the following file:

Generated on Fri Jun 13 19:46:39 2008 for OPSIMUS by  doxygen 1.5.5