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]))
|
dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||||
os.environ['PATH'] += ";" + dir
|
os.environ['PATH'] += ";" + dir
|
||||||
os.environ['PATH'] += ";" + dir + "\\..\\dist" # for testing
|
os.environ['PATH'] += ";" + dir + "\\..\\dist" # for testing
|
||||||
print os.environ['PATH']
|
|
||||||
else:
|
else:
|
||||||
externalPlayer = ["mplayer", "-really-quiet"]
|
externalPlayer = ["mplayer", "-really-quiet"]
|
||||||
|
|
||||||
|
@ -148,7 +147,7 @@ class _Recorder(object):
|
||||||
|
|
||||||
def postprocess(self):
|
def postprocess(self):
|
||||||
for c in processingChain:
|
for c in processingChain:
|
||||||
print c
|
#print c
|
||||||
p = subprocess.Popen(c, startupinfo=si)
|
p = subprocess.Popen(c, startupinfo=si)
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
|
@ -182,9 +181,9 @@ class PyAudioThreadedRecorder(threading.Thread):
|
||||||
p.terminate()
|
p.terminate()
|
||||||
data = ''.join(all)
|
data = ''.join(all)
|
||||||
wf = wave.open(processingSrc, 'wb')
|
wf = wave.open(processingSrc, 'wb')
|
||||||
wf.setnchannels(CHANNELS)
|
wf.setnchannels(PYAU_CHANNELS)
|
||||||
wf.setsampwidth(p.get_sample_size(FORMAT))
|
wf.setsampwidth(p.get_sample_size(PYAU_FORMAT))
|
||||||
wf.setframerate(RATE)
|
wf.setframerate(PYAU_RATE)
|
||||||
wf.writeframes(data)
|
wf.writeframes(data)
|
||||||
wf.close()
|
wf.close()
|
||||||
|
|
||||||
|
@ -208,6 +207,9 @@ class PyAudioRecorder(_Recorder):
|
||||||
def file(self):
|
def file(self):
|
||||||
return processingDst
|
return processingDst
|
||||||
|
|
||||||
|
def wavFile(self):
|
||||||
|
return processingSrc
|
||||||
|
|
||||||
# Mac audio support
|
# Mac audio support
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue