From 6b479fc839c0ab945024ec7b4defab53475dab90 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 25 Oct 2017 18:35:39 +1000 Subject: [PATCH] don't leave a wav file lying around when recording --- anki/sound.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/anki/sound.py b/anki/sound.py index 69f8b0208..5555c38da 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -53,7 +53,7 @@ processingChain = [] recFiles = [] processingChain = [ - ["lame", "rec.wav", processingDst, "--noreplaygain", "--quiet"], + ["lame", processingSrc, processingDst, "--noreplaygain", "--quiet"], ] # don't show box on windows @@ -277,6 +277,9 @@ class _Recorder: ret = retryWait(subprocess.Popen(cmd, startupinfo=si, env=env)) except: ret = True + finally: + if os.path.exists(processingSrc): + os.unlink(processingSrc) if ret: raise Exception(_( "Error running %s") %