From 3e7d3bbf284704f32e4669cabffd518f280e5ae8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 5 Jan 2009 14:38:15 +0900 Subject: [PATCH] add support for clearing audio queue --- anki/sound.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/anki/sound.py b/anki/sound.py index 12e839e3b..99a01fcb9 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -64,6 +64,10 @@ def playExternal(path): manager = QueueMonitor() manager.start() +def clearQueueExternal(): + global queue + queue = [] + # Mac audio support ########################################################################## @@ -98,6 +102,10 @@ try: # new handle play_(path) + def clearQueueOSX(): + global queue + queue = [] + def play_(path): global current current = NSSound.alloc() @@ -115,5 +123,7 @@ except ImportError: if sys.platform.startswith("darwin"): play = playOSX + clearAudioQueue = clearQueueOSX else: play = playExternal + clearAudioQueue = clearQueueExternal