WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-10-2007, 09:37 AM
bernie bernie is offline
Member
 
Join Date: May 2007
Posts: 18
how can I detect when a sound finished playing?

Hi there,
I looked through all the docu of vizard and the forum, but I couldn't find any info on how to detect when a sound file stopped playing.
For an experiment, I'd like to have several sound files play one after each other, and also record how long the playing took.
Any help is appreciated, I'm still new to Vizard
Reply With Quote
  #2  
Old 05-10-2007, 10:35 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Are you using Vizard 2.5 or 3.0? Also, please post Vizard related questions in the appropriate forum in the future.
Reply With Quote
  #3  
Old 05-10-2007, 12:58 PM
bernie bernie is offline
Member
 
Join Date: May 2007
Posts: 18
Sorry for posting accidentally in the wrong list, won't happen again.
I'm using Vizard 3.00.1903.
Reply With Quote
  #4  
Old 05-10-2007, 06:08 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

In Vizard 3.0 you can query the state of an audio object. So you can create a timer that checks the state and performs some code when the audio stops. Here is sample code to check the state of an audio object:
Code:
a = viz.add('myaudio.mp3')
.
.
.
state = a.getState()
if state == viz.MEDIA_STOPPED:
    print 'Audio is stopped'
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


All times are GMT -7. The time now is 04:32 PM.


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