mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
add sound back, disable 'replay current' in current editor
This commit is contained in:
parent
e3e70488ef
commit
a59097ce6c
2 changed files with 39 additions and 1 deletions
|
@ -274,6 +274,7 @@ Please do not file a bug report with Anki.<br><br>""")
|
||||||
elif state == "editCurrentFact":
|
elif state == "editCurrentFact":
|
||||||
if self.lastState == "editCurrentFact":
|
if self.lastState == "editCurrentFact":
|
||||||
return self.moveToState("saveEdit")
|
return self.moveToState("saveEdit")
|
||||||
|
self.mainWin.actionRepeatAudio.setEnabled(False)
|
||||||
self.deck.s.flush()
|
self.deck.s.flush()
|
||||||
self.showEditor()
|
self.showEditor()
|
||||||
elif state == "saveEdit":
|
elif state == "saveEdit":
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
resolve@twitch.ichi2.net.12462:1231199561
|
|
38
ankiqt/ui/sound.py
Normal file
38
ankiqt/ui/sound.py
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
|
from PyQt4.QtGui import *
|
||||||
|
from PyQt4.QtCore import *
|
||||||
|
|
||||||
|
import time
|
||||||
|
from anki.sound import Recorder, play
|
||||||
|
|
||||||
|
def getAudio(parent, string=""):
|
||||||
|
"Record and return filename"
|
||||||
|
# record first
|
||||||
|
r = Recorder()
|
||||||
|
mb = QMessageBox(parent)
|
||||||
|
but = QPushButton(_(" Stop"))
|
||||||
|
but.setIcon(QIcon(":/icons/media-playback-stop.png"))
|
||||||
|
but.setIconSize(QSize(32, 32))
|
||||||
|
mb.addButton(but, QMessageBox.RejectRole)
|
||||||
|
mb.show()
|
||||||
|
mb.setText("Recording..")
|
||||||
|
QApplication.instance().processEvents()
|
||||||
|
r.start()
|
||||||
|
mb.exec_()
|
||||||
|
r.stop()
|
||||||
|
# process
|
||||||
|
r.postprocess()
|
||||||
|
return r.file()
|
||||||
|
|
||||||
|
def recordNoiseProfile(parent):
|
||||||
|
r = Recorder()
|
||||||
|
mb = QMessageBox(parent)
|
||||||
|
mb.show()
|
||||||
|
f = time.time() + 8
|
||||||
|
r.start()
|
||||||
|
while f > time.time():
|
||||||
|
mb.setText("Sampling silence...%0.1f" % f - time.time())
|
||||||
|
QApplication.instance().processEvents()
|
||||||
|
r.stop()
|
Loading…
Reference in a new issue