WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-28-2008, 03:48 AM
Robbos Robbos is offline
Member
 
Join Date: Feb 2008
Posts: 1
Question 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.
Reply With Quote
  #2  
Old 02-28-2008, 02:02 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You need to post the code using the [code][/code] tags. This will preserve the indentation which is necessary for running Python code.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound Looping Problem JMOwens Vizard 4 09-29-2010 09:42 PM
Stuttering sound Jerry Vizard 1 06-13-2007 12:36 PM
Sound in one ear only? Jerry Vizard 1 06-29-2006 04:26 PM
sound problem alaa Vizard 7 09-02-2005 01:13 PM
3D sound in vizard virtmeg Vizard 1 01-10-2005 09:06 AM


All times are GMT -7. The time now is 11:00 PM.


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