mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
patch from saturnien, make mp3 encoding optional
This commit is contained in:
parent
119fa31eb9
commit
a72e56bc45
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ import time
|
||||||
from anki.sound import Recorder, play, generateNoiseProfile
|
from anki.sound import Recorder, play, generateNoiseProfile
|
||||||
from ankiqt.ui.utils import saveGeom, restoreGeom
|
from ankiqt.ui.utils import saveGeom, restoreGeom
|
||||||
|
|
||||||
def getAudio(parent, string=""):
|
def getAudio(parent, string="", encode=True):
|
||||||
"Record and return filename"
|
"Record and return filename"
|
||||||
# record first
|
# record first
|
||||||
r = Recorder()
|
r = Recorder()
|
||||||
|
@ -34,7 +34,7 @@ def getAudio(parent, string=""):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
r.stop()
|
r.stop()
|
||||||
# process
|
# process
|
||||||
r.postprocess()
|
r.postprocess(encode)
|
||||||
return r.file()
|
return r.file()
|
||||||
|
|
||||||
def recordNoiseProfile(parent):
|
def recordNoiseProfile(parent):
|
||||||
|
|
Loading…
Reference in a new issue