WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   how can I detect when a sound finished playing? (https://forum.worldviz.com/showthread.php?t=1074)

bernie 05-10-2007 09:37 AM

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 :o

farshizzo 05-10-2007 10:35 AM

Hi,

Are you using Vizard 2.5 or 3.0? Also, please post Vizard related questions in the appropriate forum in the future.

bernie 05-10-2007 12:58 PM

Sorry for posting accidentally in the wrong list, won't happen again.
I'm using Vizard 3.00.1903.

farshizzo 05-10-2007 06:08 PM

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'



All times are GMT -7. The time now is 11:41 AM.

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