mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
fix 10.3 audio
This commit is contained in:
parent
38cfd6e7db
commit
95447a23ec
1 changed files with 5 additions and 3 deletions
|
@ -146,10 +146,9 @@ try:
|
||||||
PYAU_CHANNELS = 1
|
PYAU_CHANNELS = 1
|
||||||
PYAU_RATE = 44100
|
PYAU_RATE = 44100
|
||||||
PYAU_INPUT_INDEX = 0
|
PYAU_INPUT_INDEX = 0
|
||||||
except ImportError:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class _Recorder(object):
|
class _Recorder(object):
|
||||||
|
|
||||||
def postprocess(self):
|
def postprocess(self):
|
||||||
|
@ -173,7 +172,10 @@ class PyAudioThreadedRecorder(threading.Thread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
chunk = 1024
|
chunk = 1024
|
||||||
|
try:
|
||||||
p = pyaudio.PyAudio()
|
p = pyaudio.PyAudio()
|
||||||
|
except NameError:
|
||||||
|
raise Exception("Recording not supported on OSX10.3.")
|
||||||
stream = p.open(format=PYAU_FORMAT,
|
stream = p.open(format=PYAU_FORMAT,
|
||||||
channels=PYAU_CHANNELS,
|
channels=PYAU_CHANNELS,
|
||||||
rate=PYAU_RATE,
|
rate=PYAU_RATE,
|
||||||
|
|
Loading…
Reference in a new issue