(Plese answer me) Mp3 files in card not play after export

mp3 files in card not play after export.

Originally, it worked well, but if you only use the export function, the audio function of the card does not work.

So I have to turn Anki off and on again for the audio to work properly.

Currently, I am using the latest version, but it is unfortunate that this problem has occurred.

As a result of testing [anki-2.1.26-windows.exe], it works well, so I think it is a problem caused by upgrading to the latest version.

How can I solve this problem?

I would be really grateful if you could solve this problem.

thanks.

please answer meā€¦ plzā€¦

Did you check the ā€œInclude mediaā€ box before exporting?

anki_O6dZeA4jek

If your field text and filenames donā€™t match exactly, Tools>Check Media in recent Anki versions should fix the problem.

I think you misunderstood the content because I did not elaborate on the explanation.

I will summarize the contents again and say the following.

The problem I am having is a problem with the latest version of Anki.

There are mp3 files on my card, but when I press the export button, these donā€™t work.

To make these work again, the only way is to turn off and on Anki or re-import the exported file.

In conclusion, clicking the export button immediately disables the mp3 function.

Please test once.

Current old version 2.1. 26 works fine with no problems.

If you have any further questions about the matter, please let me know.

I look forward to your genius ideas.

please help

I posted a post about this yesterday.

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

  1. Restart the Anki program
  2. Re-import the exported file
  3. 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.

I will wait for your reply. bro

The MP3 problem could be related to mpv.
I recommend following the steps posted by kelciour in this thread anyway:

3 Likes

I donā€™t know much about coding. Can you tell me what is the solution to the 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.

The video recording is not showing by the way.

1 Like

ė™ģ˜ģƒģ„ ģ¶”ź°€ķ•˜ź³ ģ‹¶ģ—ˆģ§€ė§Œ, ģš©ėŸ‰ė•Œė¬øģ— ģ²Øė¶€ķ•˜źø°ź°€ ģ–“ė µė‹¤.

ė‚“ģš©: ģ›ėž˜ ģž˜ ģž‘ė™ė˜ėŠ” mp3 ā†’ ė‚“ė³“ė‚“źø°(anki ģ½œėž™ģ…˜) after ā†’ not working mp3

Try using an external service like https://gofile.io/ to upload the video and link to it here.

I will try.

I have one question, I want to see the anki file in relation to the export function, program files ā†’ anki ā†’ ? What files can I select to view?

Thanks for the ping @abdo !

@hanbin the issue looks very odd.

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 - https://ankiweb.net/shared/info/383102081

Iā€™ll try to follow up on mpv and how to create the log file tomorrow.

1 Like

I tested it in its original state with no add-ons installed.

And I donā€™t use the sonic driver.

I donā€™t know much about coding, can you solve this problem?

Or do I have to wait for the next update?

I donā€™t want to solve that problem with an addon.

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.

Maybe, as a temporary workaround, mplayer instead of mpv will work for you. You can test it either by installing anki-2.1.35-windows-alternate.exe (if anki-2.1.35-windows.exe doesnā€™t work for you) or by installing the latest Anki version, downloading mplayer (it looks like the latest x86_64 build is available at https://oss.netfarm.it/mplayer/ ā†’ https://sourceforge.net/projects/mplayer-win32/files/MPlayer%20and%20MEncoder/r38328+g30322ebe3c/), then copy mplayer.exe and mplayer folder to C:\Program Files\Anki, remove or rename mpv.exe in the same folder, and open Anki.

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.

  1. Open Anki

  2. 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.

    https://docs.ankiweb.net/misc.html#debug-console

    from aqt.sound import mpvManager
    path = os.path.expanduser("~/Desktop/mpv.log.txt")
    mpvManager.set_property("log-file", path)
    print(mpvManager.get_property("log-file"))
    

    Youā€™ll see mpv.log.txt on your Desktop.

  3. Get the current working directory for media files.

    Open the Debug Console, run this code, then close the Debug Console.

    from anki.buildinfo import buildhash, version
    anki_version = f"{version} ({buildhash})"
    media_dir = os.getcwd()
    print(anki_version)
    print(media_dir)
    

    The output will be something like

    2.1.49 (dc80804a)
    C:\Users\Nickolay\AppData\Roaming\Anki2\User 1\collection.media
    
  4. 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.

  5. Then go back to the decks screen and use the export button.

  6. 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.

  7. 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.

  8. Run Tools > Check Media. It should report no missing files.

  9. Close Anki.

  10. 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.

  11. Thatā€™s it :slight_smile:


Alternatively, instead of creating mpv.log.txt, you can view mpv output in the real time.

  1. Download mpv from mpv player (Windows) - Browse /64bit at SourceForge.net

    Youā€™ll need to download mpv because Anki doesnā€™t include mpv.com that will be used to run mpv from the command prompt window and see some output.

  2. Unpack it somewhere or copy/replace mpv.exe, mpv.com, d3dcompiler_43.dll to C:\Program Files\Anki

  3. Open the Windows Command Prompt in the same folder as mpv.exe by typing cmd into the adress bar.

  1. Just in case, to prevent accidental freezing the console window and pressing Enter to unfreeze it, open the Properties and uncheck ā€œQuick Edit Modeā€.
  1. Close Anki if itā€™s open, then start mpv in a similar way as Anki does by copy-pasting this command into the Command Prompt and pressing Enter.

    mpv.com -v --idle --force-window=immediate --geometry=360+0+0 --script-opts=osc-visibility=always --audio-display=no --keep-open=no --reset-on-next-file=pause --autoload-files=no --input-media-keys=no --config-dir=%APPDATA%\Anki2 --input-ipc-server=ankimpv

    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.

  2. Open Anki and review a card with sound.

3 Likes

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?).

4 Likes

No problem. We can start by checking the ā€œcurrent working directoryā€ before and after you use the Export button.

Hereā€™s how to do it.

  1. Run this code in the debug console. Let me know the output.

    https://docs.ankiweb.net/misc.html#debug-console

    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)
    
  2. Review a card with sound (expected result: it works).

  3. Use the export button.

  4. Review a card with sound (expected result in your case: it no longer works).

  5. 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)
    

Hereā€™s a quick screencast how to do these steps.

2 Likes

Thank you for explaining it with a video attached. I will test it and let you know the results.

However, in the video you used the cogā€™s export function, which should be fine.

The problem occurs in the following situation.

  1. Click on the file located at the top
  2. Click Export
  3. anki collection Export
1 Like

2.1.49 (dc80804a)
C:\Users\sonhanbin\AppData\Roaming\Anki2\ģ‚¬ģš©ģž 1\collection.media

2.1.49 (dc80804a)
C:\Program Files\Anki