sound (version 1.4)

index
d:\cruisecontrol\game-client-system\game\common\scripts\sound.py

Sound library wrapper
 
Notes on how animation and materials (collisions) sounds work:
We create and define sounds using the sound objects. And we can assign it as Material and/or Animation. 
If this is done we will play the sound depending on what was assigned. If we assign it as Animation we will play the sound when the animation is started. 
If it was defined as Material we will play it as default sound on collision between objects. 
A Material can also be assigned more than one sound and is done though a  call where we define two Materials for each sound. 
This will be played when these two objects collide with each other.
 
Some notes on Animation:
When playing an animation it is best to define the sound object to loop if we have an looping animation. Also if we 
do not stop the current animation the sound will not stop. This means that before changing the animation we need to stop
the current playing animation so the sound stops correctly. This is handled currently by entity.setAnimation. It calls
stop animation if we have played one before.

 
Modules

      

 

gameSound

 

 

 

 

 
Classes

      

 

exceptions.Exception(exceptions.BaseException)

SoundError

Sound

 
class Sound

   

 

Methods defined here:

__init__(self, name, file, loop)

where id is the id of our camera, if camera id is 0 then we are accessing a new instance of default camera

attachToSceneNode(self, sceneNode)

destroy(self)

getFile(self)

getName(self)

play(self)

setAnimationSound(self, entity, animationName)

Will play this sound with specified sound settings when animtion is played through the python interface

setCone(self, innerAnge, outerAngle, outerGain)

setDistance(self, referenceRad, maxRad)

setGain(self, gain, gmin, gmax)

setMaterialSound(self, materialA, materialB=None)

Will play this sound with specified sound settings when materialA collides with materialB.
if materialB is not set we use this sound as the default collision sound for materialA.

setPitch(self, pitch)

stop(self)


Data and other attributes defined here:

sceneNode = None

 

 

 

 

 
Author

      

 

Kjartan A Jonsson