Sound Actuator Loop Bidirectional: pauseSound

pauseSound()
  • Pauses the sound.  Acts instantly. 
  • use startSound() to resume playing.
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


################  pause the Sound Actuator

# 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"]

# pause the Sound Actuator
act.pauseSound()