WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-07-2010, 02:24 PM
Josh Josh is offline
Member
 
Join Date: Jan 2010
Posts: 63
Wait for an audio file to end playing until new action possible?

Hi all

I'm playing a sound file in my VR. While it's playing I want all onkeydown events to be disabled. Is this possible somehow?

Thanks a lot
Josh
Reply With Quote
  #2  
Old 03-07-2010, 10:13 PM
IGoudt IGoudt is offline
Member
 
Join Date: Sep 2009
Posts: 20
I would make use of a variable 'audioPlaying = True/False' that's being checked everytime a key-event occurs.

snippets: (I use self here since I think in classes/objects)

Code:
def playAudio(self, file):
self.audioPlaying = True
..code to start audio
Code:
def onkeydown(self, key):
if not self.audioPlaying:
 ... handle keys
else:
     print "audio playing, so keys are disabled"
in the place where you register onkeydown, register the following:
Code:
viz.callback(viz.MEDIA_END, self.audioEnded)

def audioEnded(self, e):
     self.audioPlaying = False
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
IVEx file extenstion unrecognised. sindi Vizard 2 12-10-2009 01:20 AM
Read file....many issues Uttama_vizard Vizard 9 07-08-2008 02:16 PM
File Management Uttama_vizard Vizard 2 07-01-2008 09:44 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM


All times are GMT -7. The time now is 09:30 AM.


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