mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
strip sox munging
This commit is contained in:
parent
82d006d145
commit
95b3f60353
1 changed files with 9 additions and 19 deletions
|
@ -21,22 +21,13 @@ def hasSound(text):
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
# the amount of amplification
|
|
||||||
NORM_AMOUNT = "-3"
|
|
||||||
# the amount of bass
|
|
||||||
BASS_AMOUNT = "+0"
|
|
||||||
# the amount to fade at end
|
|
||||||
FADE_AMOUNT = "0.25"
|
|
||||||
|
|
||||||
processingSrc = "rec.wav"
|
processingSrc = "rec.wav"
|
||||||
processingDst = "rec.mp3"
|
processingDst = "rec.mp3"
|
||||||
processingChain = []
|
processingChain = []
|
||||||
recFiles = ["rec2.wav"]
|
recFiles = []
|
||||||
|
|
||||||
processingChain = [
|
processingChain = [
|
||||||
["sox", "rec.wav", "rec2.wav", "norm", NORM_AMOUNT,
|
["lame", "rec.wav", processingDst, "--noreplaygain", "--quiet"],
|
||||||
"bass", BASS_AMOUNT, "fade", FADE_AMOUNT],
|
|
||||||
["lame", "rec2.wav", processingDst, "--noreplaygain", "--quiet"],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
tmpdir = None
|
tmpdir = None
|
||||||
|
@ -232,15 +223,14 @@ class _Recorder(object):
|
||||||
#print c
|
#print c
|
||||||
if not self.encode and c[0] == 'lame':
|
if not self.encode and c[0] == 'lame':
|
||||||
continue
|
continue
|
||||||
|
try:
|
||||||
ret = retryWait(subprocess.Popen(c, startupinfo=si))
|
ret = retryWait(subprocess.Popen(c, startupinfo=si))
|
||||||
|
except:
|
||||||
|
ret = True
|
||||||
if ret:
|
if ret:
|
||||||
raise Exception(_("""
|
raise Exception(_(
|
||||||
Error processing audio.
|
"Error running %s") %
|
||||||
|
u" ".join(c))
|
||||||
If you're on Linux and don't have sox 14.1+, you
|
|
||||||
need to disable normalization. See the wiki.
|
|
||||||
|
|
||||||
Command was:\n""") + u" ".join(c))
|
|
||||||
|
|
||||||
class PyAudioThreadedRecorder(threading.Thread):
|
class PyAudioThreadedRecorder(threading.Thread):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue