From 95447a23ec317127e152195727aa80b8d1f0c5c3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 13 Mar 2009 07:06:21 +0900 Subject: [PATCH] fix 10.3 audio --- anki/sound.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/anki/sound.py b/anki/sound.py index fa3ee314c..7dcafb394 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -146,10 +146,9 @@ try: PYAU_CHANNELS = 1 PYAU_RATE = 44100 PYAU_INPUT_INDEX = 0 -except ImportError: +except: pass - class _Recorder(object): def postprocess(self): @@ -173,7 +172,10 @@ class PyAudioThreadedRecorder(threading.Thread): def run(self): chunk = 1024 - p = pyaudio.PyAudio() + try: + p = pyaudio.PyAudio() + except NameError: + raise Exception("Recording not supported on OSX10.3.") stream = p.open(format=PYAU_FORMAT, channels=PYAU_CHANNELS, rate=PYAU_RATE,