Python: Sound Actuator

(Haunted-House) #1

How can I stop “GameLogic.addActiveActuator(Sound, 1)” after it is triggered? It keeps playing over and over! If I set the Sound actuator as “Playend” it plays once but when triggered again it does not play! This is only when I us “GameLogic.addActiveAactuator(Sound, 1)”
How can I stop it after it has been triggered? “GameLogic.addActiveActuator(Sound, 0)” doesn’t work…

(lizard809) #2

GameLogic.addActiveActuator(Sound, 0) works but use “loop stop” NOT “loop end”, use “loop ping pong stop” NOT “loop ping pong”.
2.25 has a problem with “loop end” and “loop ping pong”

(Haunted-House) #3

Thanks for responding but, it didn’t work…
Even if I set it to “Loopstop”…

(Haunted-House) #4

Heres another question: How would you change the frequency of a sensor with python?

(lizard809) #5

im not sure its possible

(saluk) #6

I think it’s soundact.setPitch()

I used it in a music demo a while back (it’s up on my site) but it doesn’t work like you expect it to.

(lizard809) #7

he wants frequency of the sensor, not actuator

(saluk) #8

oh, haha. Sorry. I’m not sure its possible, but do a print dir(sensor) to see all the available commands.

(Haunted-House) #9

I have already dir() just about everything a while back and had found nothing about frequency pulses…
I fixed my problem with the sound actuator! :smiley: