Module KX_SoundActuator :: Class KX_SoundActuator
[frames | no frames]

Class KX_SoundActuator

SCA_ILogicBrick --+    
                  |    
      SCA_IActuator --+
                      |
                     KX_SoundActuator


Sound Actuator.

The startSound(), pauseSound() and stopSound() do not require the actuator to be activated - they act instantly.
Method Summary
string getFilename()
Returns the filename of the sound this actuator plays.
float getGain()
Gets the gain (volume) of the sound.
integer getLooping()
Returns the current loop mode of the actuator.
float getPitch()
Returns the pitch of the sound.
float getRollOffFactor()
Returns the rolloff factor for the sound.
integer getType()
Returns the operation mode of the actuator.
  setFilename(filename)
Sets the filename of the sound this actuator plays.
  setGain(gain)
Sets the gain (volume) of the sound
  setLooping(loop)
Sets the loop mode of the actuator.
  setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33)
Sets the orientation of the sound.
  setPitch(pitch)
Sets the pitch of the sound.
  setPosition(x, y, z)
Sets the position this sound will come from.
  setRollOffFactor(rolloff)
Sets the rolloff factor for the sounds.
  setType(mode)
Sets the operation mode of the actuator.
  setVelocity(vx, vy, vz)
Sets the velocity this sound is moving at.
    Play Methods
  startSound()
Starts the sound.
  pauseSound()
Pauses the sound.
  stopSound()
Stops the sound.
    Inherited from SCA_ILogicBrick
integer getExecutePriority()
Gets the execution priority of this logic brick.
KX_GameObject getOwner()
Gets the game object associated with this logic brick.
  setExecutePriority(priority)
Sets the priority of this logic brick.

Method Details

startSound()

Starts the sound.

pauseSound()

Pauses the sound.

stopSound()

Stops the sound.

getFilename()

Returns the filename of the sound this actuator plays.
Returns:
string

getGain()

Gets the gain (volume) of the sound.
Returns:
float

getLooping()

Returns the current loop mode of the actuator.
Returns:
integer

getPitch()

Returns the pitch of the sound.
Returns:
float

getRollOffFactor()

Returns the rolloff factor for the sound.
Returns:
float

getType()

Returns the operation mode of the actuator.
Returns:
KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
           (type=integer)

setFilename(filename)

Sets the filename of the sound this actuator plays.
Parameters:
filename
           (type=string)

setGain(gain)

Sets the gain (volume) of the sound
Parameters:
gain - 0.0 (quiet) <= gain <= 1.0 (loud)
           (type=float)

setLooping(loop)

Sets the loop mode of the actuator.
Parameters:
loop - - Play Stop 1
  • Play End 2
  • Loop Stop 3
  • Loop End 4
  • Bidirection Stop 5
  • Bidirection End 6

           (type=integer)

Bug: There are no constants defined for this method!

setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33)

Sets the orientation of the sound.

The nine parameters specify a rotation matrix:
       | o11, o12, o13 |
       | o21, o22, o23 |
       | o31, o32, o33 |

setPitch(pitch)

Sets the pitch of the sound.
Parameters:
pitch
           (type=float)

setPosition(x, y, z)

Sets the position this sound will come from.
Parameters:
x - The x coordinate of the sound.
           (type=float)
y - The y coordinate of the sound.
           (type=float)
z - The z coordinate of the sound.
           (type=float)

setRollOffFactor(rolloff)

Sets the rolloff factor for the sounds.

Rolloff defines the rate of attenuation as the sound gets further away. Higher rolloff factors shorten the distance at which the sound can be heard.
Parameters:
rolloff
           (type=float)

setType(mode)

Sets the operation mode of the actuator.
Parameters:
mode - KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP
           (type=integer)

setVelocity(vx, vy, vz)

Sets the velocity this sound is moving at.

The sound's pitch is determined from the velocity.
Parameters:
vx - The vx coordinate of the sound.
           (type=float)
vy - The vy coordinate of the sound.
           (type=float)
vz - The vz coordinate of the sound.
           (type=float)

Generated by Epydoc 2.1 on Thu Feb 1 00:12:33 2007 http://epydoc.sf.net