![]() |
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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"
Code:
viz.callback(viz.MEDIA_END, self.audioEnded)
def audioEnded(self, e):
self.audioPlaying = False
|
![]() |
|
|
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 |