WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-29-2011, 11:28 AM
WaterBottle WaterBottle is offline
Member
 
Join Date: Aug 2011
Posts: 2
Adding Audio to CAF Animation

What i need to do is play audio and a animation at the same time. I would like to combined those in one .caf file. Using 3ds max how can i make the caf file have audio so if i play it in vizard? Thanks
Reply With Quote
  #2  
Old 08-29-2011, 11:42 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The Cal3D .caf file format is just for animations. In Vizard, you could play audio when the animation begins and stop the audio when it's done.
Reply With Quote
  #3  
Old 08-29-2011, 12:00 PM
WaterBottle WaterBottle is offline
Member
 
Join Date: Aug 2011
Posts: 2
I was thinking about doing that but every time i play an audio and a animation at the same time one waits for the other to be complete. I tried using
Code:
viz.playSound('filename')

self.VizBody.state(1)
I know there must be a better way to do this i am just new to vizard.

Thanks
Reply With Quote
  #4  
Old 08-30-2011, 07:54 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could use a task function to play audio and stop if after the action is done:
Code:
import viz
import vizact
import viztask
viz.go()

avatar = viz.addAvatar('vcc_male.cfg',pos=[0,0,5],euler=[180,0,0])
avatar.state(1)
action = vizact.animation(3)

audio = viz.addAudio('jfk.wav',loop=1)

def animationTask():
	
	while True:
		yield viztask.waitKeyDown(' ')
		audio.play()
		yield viztask.runAction(avatar,action)
		audio.stop()	

viztask.schedule(animationTask())
If the sound is attached to the avatar you could use a sequence of actions:
Code:
import viz
import vizact
viz.go()

avatar = viz.addAvatar('vcc_male.cfg',pos=[0,0,5],euler=[180,0,0])
avatar.state(1)

startSound = vizact.method.playsound('jfk.wav',viz.LOOP)
action = vizact.animation(3)
stopSound = vizact.method.playsound('jfk.wav',viz.STOP)

actionSequence = vizact.sequence(startSound,action,stopSound)

vizact.onkeydown(' ',avatar.addAction,actionSequence)
Reply With Quote
Reply

Tags
animation, caf

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
Clarification on CAL3D Avatar Animation in Vizard shivanangel Vizard 2 11-22-2010 08:16 AM
adding more than 1 action for avatar animation slider control yak Vizard 0 07-21-2009 12:22 PM
Animation Tracks.... k_iwan Vizard 2 03-26-2007 06:52 PM
Jumpy animation Elizabeth S Vizard 1 11-08-2006 03:11 PM
avatar animation problems jrodman Vizard 1 01-18-2006 10:12 AM


All times are GMT -7. The time now is 01:39 AM.


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