#1
|
|||
|
|||
On click Sound Play Problems
Hi i am also a university student on the same project as "Psirus" (who recently joined) and have run into a problem similar to his but cannot seem to find the solution within the help he was given.
I wish to make a set of spheres all emit sound but the sound be muted until they are clicked and effectively "activated" I have managed to get an error message on click (which means my onpick command is obviously working (YAY)), and can remove the error message by adding the relevant variable at the end, but the sound does still not play. Hopefully someone can shed some light.. Heres my code... Thanks in advance import viz viz.STEREO viz.go() #smallballs sball1 = viz.add('sb1.wrl') ##sball2 = viz.add('sb1.wrl') ##sball3 = viz.add('sb1.wrl') ##sball4 = viz.add('sb1.wrl') ##sball5 = viz.add('sb1.wrl') ##sball6 = viz.add('sb1.wrl') These are commented out until i can get one working #making music play when click on a sphere def soundToggle1(sball1): sball1.active = not sball1.active if sball1.active: sball1.audio.volume(1) else: sball1.audio.volume(0) ########active sound on click sball1.audio = viz.addAudio('sound1.wav',loop=True,volume=0.0) sball1.active = False vizact.onpick(sball1,soundToggle1,sball1) The bit in red is the bit that can remove the error message but does nothing. |
#2
|
|||
|
|||
You need to post the code using the [code][/code] tags. This will preserve the indentation which is necessary for running Python code.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sound Looping Problem | JMOwens | Vizard | 4 | 09-29-2010 10:42 PM |
Stuttering sound | Jerry | Vizard | 1 | 06-13-2007 01:36 PM |
Sound in one ear only? | Jerry | Vizard | 1 | 06-29-2006 05:26 PM |
sound problem | alaa | Vizard | 7 | 09-02-2005 02:13 PM |
3D sound in vizard | virtmeg | Vizard | 1 | 01-10-2005 10:06 AM |