fix 'lame missing' message not being shown

https://forums.ankiweb.net/t/cant-use-voice-recorder/8753
This commit is contained in:
Damien Elmes 2021-03-29 19:52:30 +10:00
parent ddcb2adf71
commit bcb1a2a329

View File

@ -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)