Module KX_SoundActuator
[hide private]
[frames] | no frames]

Source Code for Module KX_SoundActuator

  1  # $Id: KX_SoundActuator.py 15444 2008-07-05 17:05:05Z lukep $ 
  2  # Documentation for KX_SoundActuator 
  3  from SCA_IActuator import * 
  4   
5 -class KX_SoundActuator(SCA_IActuator):
6 """ 7 Sound Actuator. 8 9 The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require 10 the actuator to be activated - they act instantly. 11 12 @group Play Methods: startSound, pauseSound, stopSound 13 """
14 - def setFilename(filename):
15 """ 16 Sets the filename of the sound this actuator plays. 17 18 @type filename: string 19 """
20 - def getFilename():
21 """ 22 Returns the filename of the sound this actuator plays. 23 24 @rtype: string 25 """
26 - def startSound():
27 """ 28 Starts the sound. 29 """
30 - def pauseSound():
31 """ 32 Pauses the sound. 33 """
34 - def stopSound():
35 """ 36 Stops the sound. 37 """
38 - def setGain(gain):
39 """ 40 Sets the gain (volume) of the sound 41 42 @type gain: float 43 @param gain: 0.0 (quiet) <= gain <= 1.0 (loud) 44 """
45 - def getGain():
46 """ 47 Gets the gain (volume) of the sound. 48 49 @rtype: float 50 """
51 - def setPitch(pitch):
52 """ 53 Sets the pitch of the sound. 54 55 @type pitch: float 56 """
57 - def getPitch():
58 """ 59 Returns the pitch of the sound. 60 61 @rtype: float 62 """
63 - def setRollOffFactor(rolloff):
64 """ 65 Sets the rolloff factor for the sounds. 66 67 Rolloff defines the rate of attenuation as the sound gets further away. 68 Higher rolloff factors shorten the distance at which the sound can be heard. 69 70 @type rolloff: float 71 """
72 - def getRollOffFactor():
73 """ 74 Returns the rolloff factor for the sound. 75 76 @rtype: float 77 """
78 - def setLooping(loop):
79 """ 80 Sets the loop mode of the actuator. 81 82 @bug: There are no constants defined for this method! 83 @param loop: - Play Stop 1 84 - Play End 2 85 - Loop Stop 3 86 - Loop End 4 87 - Bidirection Stop 5 88 - Bidirection End 6 89 @type loop: integer 90 """
91 - def getLooping():
92 """ 93 Returns the current loop mode of the actuator. 94 95 @rtype: integer 96 """
97 - def setPosition(x, y, z):
98 """ 99 Sets the position this sound will come from. 100 101 @type x: float 102 @param x: The x coordinate of the sound. 103 @type y: float 104 @param y: The y coordinate of the sound. 105 @type z: float 106 @param z: The z coordinate of the sound. 107 """
108 - def setVelocity(vx, vy, vz):
109 """ 110 Sets the velocity this sound is moving at. 111 112 The sound's pitch is determined from the velocity. 113 114 @type vx: float 115 @param vx: The vx coordinate of the sound. 116 @type vy: float 117 @param vy: The vy coordinate of the sound. 118 @type vz: float 119 @param vz: The vz coordinate of the sound. 120 """
121 - def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33):
122 """ 123 Sets the orientation of the sound. 124 125 The nine parameters specify a rotation matrix:: 126 | o11, o12, o13 | 127 | o21, o22, o23 | 128 | o31, o32, o33 | 129 """
130
131 - def setType(mode):
132 """ 133 Sets the operation mode of the actuator. 134 135 @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP 136 @type mode: integer 137 """
138
139 - def getType():
140 """ 141 Returns the operation mode of the actuator. 142 143 @rtype: integer 144 @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP 145 """
146