From bcb1a2a3297c8da9bcad8c4396895e7e755ff960 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 29 Mar 2021 19:52:30 +1000 Subject: [PATCH] fix 'lame missing' message not being shown https://forums.ankiweb.net/t/cant-use-voice-recorder/8753 --- qt/aqt/sound.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt/aqt/sound.py b/qt/aqt/sound.py index 70c6981cf..55ce9d0a9 100644 --- a/qt/aqt/sound.py +++ b/qt/aqt/sound.py @@ -494,7 +494,11 @@ def encode_mp3(mw: aqt.AnkiQt, src_wav: str, on_done: Callable[[str], None]) -> dst_mp3 = src_wav.replace(".wav", "%d.mp3" % time.time()) def _on_done(fut: Future) -> None: - fut.result() + if exc := fut.exception(): + print(exc) + showWarning(tr.editing_couldnt_record_audio_have_you_installed()) + return + on_done(dst_mp3) mw.taskman.run_in_background(lambda: _encode_mp3(src_wav, dst_mp3), _on_done)