WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   how to clear background sound of an animation (https://forum.worldviz.com/showthread.php?t=1741)

znchb 12-08-2008 02:34 AM

how to clear background sound of an animation
 
#the following program try to clean the animation-teacher and the sound,
#but I can't perform the later one, could you please help me? Thanks
import viz
import vizact
viz.go()
viz.clearcolor(viz.SKYBLUE)
viz.add('tut_ground.wrl')

teacher = viz.add('c:\\Program Files\\WorldViz\\Vizard30\\resources\\vcc_female.c fg')
teacher.translate(1,1,1)
viz.MainView.translate(0,2,-10)
teacher.setEuler(-180,0,0)
teacher.state(14)
#speech = vizact.speak('c:\\Program Files\\WorldViz\\Vizard30\\resources\\carousel.wav ')
teacher.addAction(vizact.speak('c:\\Program Files\\WorldViz\\Vizard30\\resources\\carousel.wav '))

def clean():

teacher.clearActions()#vizact.speak)
teacher.remove()

vizact.onkeydown(' ', clean)

Jeff 12-08-2008 11:04 AM

Try the following to end the sound in the middle of running a speak action. In order to preserve the indentation of your code use the code tags the next time you post some code.

Code:

import viz
viz.go()

viz.clearcolor(viz.SKYBLUE)

viz.add('tut_ground.wrl')

teacher = viz.add('vcc_female.cfg', pos = [0,0,5], euler = [180,0,0])
teacher.state(14)
speech = vizact.speak('carousel.wav')
teacher.addAction(speech)

def clean():

        teacher.clearActions()
        teacher.remove()
        viz.playsound('carousel.wav', viz.STOP)

vizact.onkeydown(' ', clean)



All times are GMT -7. The time now is 01:43 PM.

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