Sound Actuator Loop Bidirectional: volume_maximum

volume_maximum
  • gets/sets maximum volume of the 3D sound
     
  • Sound Actuator name:  Maximum Gain

Type: 
  • float number

Range:

  • 0.00 to 1.00
Loop Bidirectional:
  • Plays the sound file from start to finish.  Then finish to start.  Over and over.
  • Positive Pulse:  Starts playing the sound file from the beginning.
  • Negative pulse:  Keeps playing the sound file until it reaches the end, then stops playing.
Sample Code


################  get the maximum volume of the 3D sound

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Song

act = cont.actuators["Song"]

# get the maximum volume of the 3D sound
vol = act.volume_maximum
 
Sample Code


################  set the maximum volume of the 3D sound

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the actuator attached to the controller
# my actuator is named Song

act = cont.actuators["Song"]

# set the maximum volume of the 3D sound to 1.0
act.volume_maximum = 1.0