Sound Actuator Loop Bidirectional: startSound

startSound()
  • Plays the sound
     
  • with pauseSound() -- resumes playing where sound was paused
     
  • with stopSound() --plays the sound from the beginning
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


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

# Start the Sound Actuator
act.startSound()