mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
update recording time more frequently; remove print statement
This commit is contained in:
parent
a9614a3971
commit
1114ca75df
2 changed files with 6 additions and 5 deletions
|
@ -835,7 +835,6 @@ time = %(time)d;
|
|||
def onRecordVoice(self) -> None:
|
||||
def after_record(path: str):
|
||||
self._recordedAudio = path
|
||||
print(path)
|
||||
self.onReplayRecorded()
|
||||
|
||||
record_audio(self.mw, self.mw.taskman, False, after_record)
|
||||
|
|
|
@ -514,7 +514,7 @@ class RecordDialog(QDialog):
|
|||
self.setWindowTitle("Anki")
|
||||
icon = QLabel()
|
||||
icon.setPixmap(QPixmap(":/icons/media-record.png"))
|
||||
self.label = QLabel("")
|
||||
self.label = QLabel("...")
|
||||
hbox = QHBoxLayout()
|
||||
hbox.addWidget(icon)
|
||||
hbox.addWidget(self.label)
|
||||
|
@ -556,14 +556,16 @@ class RecordDialog(QDialog):
|
|||
self._timer = t = QTimer(self._parent)
|
||||
t.timeout.connect(self._on_timer)
|
||||
t.setSingleShot(False)
|
||||
t.start(300)
|
||||
t.start(100)
|
||||
|
||||
def _on_timer(self):
|
||||
duration = self._recorder.duration()
|
||||
# disable mute after recording starts to avoid clicks/pops
|
||||
if duration > 0 and self._recorder.isMuted():
|
||||
if duration < 300:
|
||||
return
|
||||
if self._recorder.isMuted():
|
||||
self._recorder.setMuted(False)
|
||||
self.label.setText(tr(TR.MEDIA_RECORDINGTIME) % (duration/1000.0))
|
||||
self.label.setText(tr(TR.MEDIA_RECORDINGTIME, secs="%0.1f" % (duration/1000.0)))
|
||||
|
||||
def accept(self):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue