WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   3D sound problem? (https://forum.worldviz.com/showthread.php?t=2760)

shahramy 05-28-2010 08:44 AM

3D sound problem?
 
hi
I have used 3D sound attached in one of my node and I want play sound when I press specific key. it`s done but while i hold down the key. the sound does not play sequentially and it plays with a little interval and its not good for me.
has any body idea ?

Jeff 05-28-2010 09:51 AM

So you want to play a looping sound when a key is pressed? If so, look at the following:
Code:

import viz
viz.go()

ball = viz.add('ball.wrl',pos = [0,2,8])

sound = ball.playsound('boing!.wav', viz.PAUSE)

#play and pause looping sound with keypresses
vizact.onkeydown('1',sound.play,viz.LOOP)
vizact.onkeydown('2',sound.pause)



All times are GMT -7. The time now is 11:18 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC