I’m sure it’s a bug, but I haven’t received an answer to the exact solution to this.
The problem I am having is:
Currently I am using the latest version 2.1.49.
I was studying hard through Anki. It was confirmed that the Anki card contains various audio files such as MP3 and TTS and works well.
But the problem occurs after clicking the export button as shown below.
Export → Anki Collection Package (Check Include Media) → After pressing the Export button, if you do card learning without exiting Anki, the audio does not work.
Note that Audio includes both MP3 files and TTS.
As a result of my various tests, the solution to this is
Restart the Anki program
Re-import the exported file
When exporting, there is a way to export as an Anki Deck Package rather than as Anki Collection
Package.
As a result of testing in version 2.1.26, it was confirmed that the audio works well even after export → collection package.
So I’m pretty sure the problem occurred when I upgraded to the latest version.
I want to solve this problem because I personally want to use the latest version.
I’ve asked a question before, but no one answered it properly, so I’m asking again.
I really wish there was someone who could help me to solve this problem.
It’s not clear what is causing the issue, so you have to troubleshoot by following the steps to find the problem. @kelciour provided detailed steps for that.
I couldn’t find this information in your current or previous posts and will assume that you either don’t have any add-on installed or already tried to turn them off to make sure that the problem wasn’t caused by the add-on - https://faqs.ankiweb.net/when-problems-occur.html - and Tools > Check Media reported no missing audio files.
If you have “Sonic Studio” installed,
Otherwise, for now I can only suggest to try VLC instead of mpv by installing VLC and this add-on - No Sound Fix (VLC) - AnkiWeb
I’ll try to follow up on mpv and how to create the log file tomorrow.
I don’t know, but the next update won’t help much if the problem isn’t found in the code and fixed. I guess, it needs some further investigation why it happens and understanding what’s going on.
To help understand why the sound won’t work anymore with mpv, something like this can be done. There will be a lot of words, but it’s just about enabling logging for mpv and printing the current working directory before and after export.
Open Anki
Enable logging for mpv (just this time, until Anki or mpv hasn’t been closed).
Open the Debug Console, run this code, then close the Debug Console.
Review a card with the sound, then click on the play button once or twice (just front or back, without moving to the next card). As I understand, the sound will work fine.
Then go back to the decks screen and use the export button.
Review the same card again, then click on the play button once or twice. As I understand, at this moment the sound won’t work anymore.
Get the current working directory for media files (again).
Open the Debug Console, run this code, then close the Debug Console.
media_dir = os.getcwd()
print(media_dir)
The output might be the same as before or maybe it will be different this time.
Run Tools > Check Media. It should report no missing files.
Close Anki.
Look at mpv.log.txt on your Desktop or upload it somewhere, e.g. https://gofile.io, maybe it’ll contain some information why mpv can’t play the same sound file the second time.
That’s it
Alternatively, instead of creating mpv.log.txt, you can view mpv output in the real time.
If you see [ipc] Couldn't create first pipe instance, you must have some mpv process floating around. Close it with the Task Manager or Process Explorer and rerun the command again to start mpv.
I just read the answer you wrote really hard. Thank you very much.
However, I have no knowledge of coding, so it is too difficult for me to understand what you are explaining.
Simply how can I solve this problem?
Will there be a release with this issue fixed in the next update?
I am very interested and curious about these two things.
It would be really appreciated if the developer could fix this bug.
If you follow carefully the steps, you should encounter no issue. If you did (you fail to get through a step), please say so, and that step will be explained more in details. The problem cannot be solved if it is not identified, and this debugging steps are necessary to find out what the problem is.
So, to answer your questions, to solve this problem you need to repeat the steps and post the result, so that we can think of a solution, and no it is probably not going to be fixed in the next update if the problem has not been found yet (it’s hard to patch a problem you don’t know anything about, right?).
When asked to enter text into the “debug console”, please start Anki, and in the main window, press Ctrl+Shift+; (the control key, shift key, and semi-colon key at the same time).
In the window that has popped up, please paste the text you were asked to paste in the top section. When you’ve done so, please press Ctrl+Return, and some text should appear in the bottom section. If you’ve been asked to paste the resulting output, please copy it from the bottom area, and paste it back to the support person.
from anki.buildinfo import buildhash, version
anki_version = f"{version} ({buildhash})"
media_dir = os.getcwd()
print(anki_version)
print(media_dir)
Review a card with sound (expected result: it works).
Use the export button.
Review a card with sound (expected result in your case: it no longer works).
Rerun the same code in the debug console. Let me know the output.
from anki.buildinfo import buildhash, version
anki_version = f"{version} ({buildhash})"
media_dir = os.getcwd()
print(anki_version)
print(media_dir)