mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
fix recording, remove debugging
This commit is contained in:
parent
f5feaaa782
commit
f3368d3c1e
1 changed files with 7 additions and 5 deletions
|
@ -64,7 +64,6 @@ if sys.platform.startswith("win32"):
|
|||
dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
os.environ['PATH'] += ";" + dir
|
||||
os.environ['PATH'] += ";" + dir + "\\..\\dist" # for testing
|
||||
print os.environ['PATH']
|
||||
else:
|
||||
externalPlayer = ["mplayer", "-really-quiet"]
|
||||
|
||||
|
@ -148,7 +147,7 @@ class _Recorder(object):
|
|||
|
||||
def postprocess(self):
|
||||
for c in processingChain:
|
||||
print c
|
||||
#print c
|
||||
p = subprocess.Popen(c, startupinfo=si)
|
||||
while 1:
|
||||
try:
|
||||
|
@ -182,9 +181,9 @@ class PyAudioThreadedRecorder(threading.Thread):
|
|||
p.terminate()
|
||||
data = ''.join(all)
|
||||
wf = wave.open(processingSrc, 'wb')
|
||||
wf.setnchannels(CHANNELS)
|
||||
wf.setsampwidth(p.get_sample_size(FORMAT))
|
||||
wf.setframerate(RATE)
|
||||
wf.setnchannels(PYAU_CHANNELS)
|
||||
wf.setsampwidth(p.get_sample_size(PYAU_FORMAT))
|
||||
wf.setframerate(PYAU_RATE)
|
||||
wf.writeframes(data)
|
||||
wf.close()
|
||||
|
||||
|
@ -208,6 +207,9 @@ class PyAudioRecorder(_Recorder):
|
|||
def file(self):
|
||||
return processingDst
|
||||
|
||||
def wavFile(self):
|
||||
return processingSrc
|
||||
|
||||
# Mac audio support
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue