Unable to play longer audio on cards

Hi all

Hoping someone can help. I’ve just updated Anki to 2.1.6. As part of my language studies, I have a lot of dialogues, recorded texts, etc. and I use Anki as a way to schedule reviews to keep the language fresh. The “Front” of the card is the title and audio and the reverse is either blank or I add the text. Since updating, most of the audio plays automatically on the cards but one sub-deck will not play the audio, even if click on the play button or try opening the card as if to edit. The only thing I can think of is that the cards won’t play due to the length as the cards share the same card template and I have confirmed that the audio files are still in the media folder. These audio files are typically four to eight minutes whereas most of the other cards on the other couple of decks (they’re split into three or four decks based on the type of text or if it is a main or supplementary textbook) are usually between about 30 seconds and about three minutes.

Is this the reason the card won’t play, and is there a “hack” or an add-on I could use? It’s not really an option to split the audio into smaller files as each dialogue/narrative is self-contained.

Thanks

The length shouldn’t make a difference. Does Tools>Check Media report the files as missing?

Hi

Thanks fore getting back to me. I’ve run the various tools several times and manually searched in the media file and the files are definitely there. What I have noticed is that I’ll go into “edit”, cut and paste the file name and then search in the media folder and then search in “browse” on Anki and then on some occasions when I go back to the card the audio file plays as if one, two or all three of these actions somehow makes the audio play. As mentioned, I have literally thousands of audio files ranging anywhere from one second to several minutes and this is literally the only ones that don’t work.

I guess I’ll try removing the files, renaming and putting the files back in after changing the file name on Anki and see if that works.

Thanks again for your response.

I’m not sure if this is the case, but try to update to the latest Anki version (2.1.29).

If it doesn’t help, open the Debug Console - https://docs.ankiweb.net/#/misc?id=debug-console - copy-paste the following lines and press Ctrl+Return or Cmd+Return if you’re on Mac.

Try to review a few cards with audio and if audio stops playing, look at the last lines in mpv.log.txt on Desktop, maybe it’ll give some idea what’s going on.

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"))
1 Like

Hello,

I have the same problem. Mac with version 2.1.29. A number of audio files stopped playing after I updated Anki, but not all. I created a new card with three different audio files for the same phrase and none of them work. Here is the error log.


1692.909][v][cplayer] finished playback, success (reason 0)
[1692.909][i][cplayer]
[1693.136][v][cplayer] Run command: disable-section, flags=0, args=[showhide]
[1698.251][v][cplayer] Run command: loadfile, flags=0, args=[/Users/jamesbairey/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3, append-play, ]
[1698.252][i][cplayer] Playing: /Users/myaccount/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3
[1698.252][v][cplayer] Running hook: ytdl_hook/on_load
[1698.253][v][cplayer] Run command: hook-ack, flags=0, args=[on_load]
[1698.256][v][cplayer] Run command: enable-section, flags=0, args=[showhide, allow-hide-cursor+allow-vo-dragging]
[1698.257][v][file] Opening /Users/myaccount/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3
[1698.258][e][file] Cannot open file ‘/Users/myaccount/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3’: No such file or directory
[1698.258][e][stream] Failed to open /Users/myaccount/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3.
[1698.258][v][cplayer] Opening failed or was aborted: /Users/jamesbairey/Library/Application Support/Anki2/User 1/collection.media/pronunciation_fr_Ã _tout_Ã _l’heure!.mp3
[1698.260][v][cplayer] finished playback, loading failed (reason 4)
[1698.260][i][cplayer]
[1698.260][v][cplayer] Run command: disable-section, flags=0, args=[showhide]

Is it only happening with files that have accents in them? Does the issue persist after using Tools>Check Media?

Hi Damien,

I am a huge Anki fan, so thanks for all of your great work. I use the desktop version and app for an hour or two every day.

It still does not work after check media
It only started after the new update
It does not work with a random collection of words. My decks are French to lots of word with accents do work. I can create a new card, and the word does not work. I can download different people saying the word from Forvo and that word just doesn’t work. Pretty odd. He are some that did’t work today.

[sound:pronunciation_fr_il_pleut,_il_mouille,_c’est_la_fête_à _la_grenouille.mp3]

[sound:pronunciation_fr_une_menuisière.mp3]

(Attachment pronunciation_fr_tout_Ã _l’heure.mp3 is missing)

(Attachment pronunciation_fr_tout_Ã _l’heure-2.mp3 is missing)

(Attachment pronunciation_fr_tout_Ã _l’heure-3.mp3 is missing)

(Attachment pronunciation_fr_Ã _tout_Ã _l’heure!.mp3 is missing)

I found this. These are all Forvo downloads. I try to re-download them, and it still doesn’t work.

James

Trash folder: ⁨⁨8264⁩ files, ⁨252.57⁩MB⁩
Missing files: ⁨47⁩
Unused files: ⁨2⁩

The following files are referenced by cards, but were not found in the media folder:
Missing: ⁨pronunciation_fr_aider_à_y_parvenir.mp3⁩
Missing: ⁨pronunciation_fr_aiguille_à_tricoter.mp3⁩
Missing: ⁨pronunciation_fr_c’est_une_vraie_cohue_là-bas.mp3⁩
Missing: ⁨pronunciation_fr_ce_gâteau_est_fait_à_base_de_farine_de_maïs.mp3⁩
Missing: ⁨pronunciation_fr_ceux_à_cheveux_longs.mp3⁩
Missing: ⁨pronunciation_fr_corbeille_à_papier.mp3⁩
Missing: ⁨pronunciation_fr_de_deux_heures_à_douze_heures.mp3⁩
Missing: ⁨pronunciation_fr_demain_à_quatorze_heures.mp3⁩
Missing: ⁨pronunciation_fr_donner_du_grain_à_moudre.mp3⁩
Missing: ⁨pronunciation_fr_donner_les_mains_à.mp3⁩
Missing: ⁨pronunciation_fr_dorénavant,_il_faudra_veiller_à.mp3⁩
Missing: ⁨pronunciation_fr_d’ores_et_déjà.mp3⁩
Missing: ⁨pronunciation_fr_excellent_hotel._toutefois_le_service_restera_à_améliorer…mp3⁩
Missing: ⁨pronunciation_fr_il_pleut,_il_mouille,_c’est_la_fête_à_la_grenouille.mp3⁩
Missing: ⁨pronunciation_fr_il_venait_d’échouer_à_décrocher_une_médaille_par_équipe…mp3⁩
Missing: ⁨pronunciation_fr_jusqu’à_quelle_heure_tourne_le_bus_⁩
Missing: ⁨pronunciation_fr_j’irai_à_marseille.mp3⁩
Missing: ⁨pronunciation_fr_le_centre_est_dédié_à_promouvoir_la_gestion_durable_des_ressources_naturelles…mp3⁩
Missing: ⁨pronunciation_fr_le_métro_est_bondé_à_l’heure_de_pointe.mp3⁩
Missing: ⁨pronunciation_fr_les_fruits_à_noyau.mp3⁩
Missing: ⁨pronunciation_fr_les_ouvriers_dressèrent_un_échafaudage_devant_l’immeuble_à_ravaler…mp3⁩
Missing: ⁨pronunciation_fr_leurs_vies_étaient_déjà_gâchées._ils_ne_le_savaient_pas_encore…mp3⁩
Missing: ⁨pronunciation_fr_là-haut.mp3⁩
Missing: ⁨pronunciation_fr_mener_à_bien_une_œuvre.mp3⁩
Missing: ⁨pronunciation_fr_mon_filleul_a_grimpé_à_un_tilleul…mp3⁩
Missing: ⁨pronunciation_fr_nous_ferons_un_don_à_l’association_de_votre_choix…mp3⁩
Missing: ⁨pronunciation_fr_on_dit_«mou»,_par_opposition_à_«dur»…mp3⁩
Missing: ⁨pronunciation_fr_parler_à_la_cantonade.mp3⁩
Missing: ⁨pronunciation_fr_puisque_j’en_parle_déjà.mp3⁩
Missing: ⁨pronunciation_fr_que_faites-vous_debout_à_cette_heure_de_la_nuit_⁩
Missing: ⁨pronunciation_fr_s’atteler_à.mp3⁩
Missing: ⁨pronunciation_fr_se_lever_à_heure_quelconque.mp3⁩
Missing: ⁨pronunciation_fr_son_aîné_a_déjà_trente_ans.mp3⁩
Missing: ⁨pronunciation_fr_s’en_prendre_à.mp3⁩
Missing: ⁨pronunciation_fr_tenir_en_garde_à_vue.mp3⁩
Missing: ⁨pronunciation_fr_tourner_à_droite.mp3⁩
Missing: ⁨pronunciation_fr_tout_à_l’heure-2.mp3⁩
Missing: ⁨pronunciation_fr_à_cause_d’une_averse_inopportune,_j’ai_dû_couru_chez_moi.mp3⁩
Missing: ⁨pronunciation_fr_à_l’aune_de.mp3⁩
Missing: ⁨pronunciation_fr_à_l’improviste.mp3⁩
Missing: ⁨pronunciation_fr_à_la_pelle.mp3⁩
Missing: ⁨pronunciation_fr_à_mon_avis.mp3⁩
Missing: ⁨pronunciation_fr_à_présent_que.mp3⁩
Missing: ⁨pronunciation_fr_à_rebours.mp3⁩
Missing: ⁨pronunciation_fr_à_sa_guise.mp3⁩
Missing: ⁨pronunciation_fr_épingle_à_cheveux.mp3⁩
Missing: ⁨pronunciation_fr_étaient_à_faire.mp3⁩

The following files were found in the media folder, but do not appear to be used on any cards:
Unused: ⁨pronunciation_fr_tout_Ã _l’heure.mp3⁩
Unused: ⁨pronunciation_fr_Ã _tout_Ã _l’heure!.mp3⁩

@heliotrope It seems like something happened and à got replaced with à and é with é.

Forvo:   pronunciation_fr_puisque_j'en_parle_d é  j à.mp3
Missing: ⁨pronunciation_fr_puisque_j’en_parle_d é j à .mp3⁩

Forvo:  pronunciation_fr _à_  tout _à_  l'heure!.mp3
Unused: ⁨pronunciation_fr _Ã _ tout _Ã _ l’heure!.mp3⁩

Forvo:   pronunciation_fr_dor é  navant,_il_faudra_veiller_à.mp3
Missing: pronunciation_fr_dor é navant,_il_faudra_veiller_à .mp3⁩
  1. Maybe download again pronunciation_fr_à_tout_à_l'heure!.mp3 from https://forvo.com/word/à_tout_à_l’heure!/#fr
  2. Restart Anki while holding down the shift key to temporarily disable the add-ons
  3. Create a new Anki profile (File - Switch Profile)
  4. Add a new Basic card and drag-and-drop pronunciation_fr_à_tout_à_l'heure!.mp3 to the Front field, or use the attach button.
  5. If everything is okay, Anki should play back the audio file.
  6. If there’s no sound, use Tools - Check Media.

What steps are you taking to get the files from Forvo into your cards?

I download them on a Mac and drag them into a pronunciation field. Hundreds of them work and these 49 fail. The funny thing is that for a certain phrase, such as tout à l’heure, I can download three different version of the phrase and none of them work. I can create a new card and none of the different Forno files play.

@heliotrope It’s very strange that there’s no audio with “tout à l’heure” that was just downloaded from Forvo. Maybe again enable logging via the 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"))

open the Add window and add one of the downloaded mp3 files (“tout à l’heure”), wait 5 seconds to give Anki some time to play it back, and look at mpv.log.txt on Desktop.

The last time it contained Cannot open file 'pronunciation_fr_Ã _tout_Ã _l’heure!.mp3’: No such file or directory and Tools - Check Media verified it, but it should be different this time.

I thought I would let you know that the problem still persists. I downloaded tête à tête from Forvo today and it won’t play. I agree that Anki seems to be replacing à with Ã, but I don’t know what to do about it. Check media doesn’t help.

I downloaded the newest version of Anki yesterday.

Don’t know if others are having the same problem, but thought you would want to know. Thanks!

If I create a new Anki profile, the audio works for me and Check Media shows no unused or missing audio files.

I did the exact same thing and get the same error message when I run Check Media.

Missing files: ⁨1⁩
Unused files: ⁨1⁩

The following files are referenced by cards, but were not found in the media folder:
Missing: ⁨pronunciation_fr_tête-à-tête.mp3⁩

The following files were found in the media folder, but do not appear to be used on any cards:
Unused: ⁨pronunciation_fr_tête-à -tête.mp3⁩

This is really strange. It’s the same filename but it’s listed as missing and as unused at the same time.

Take a look at the collection.media folder (in a new Anki profile with just one card). Do you see pronunciation_fr_tête-à -tête.mp3 or pronunciation_fr_tête_à_tête.mp3?

https://docs.ankiweb.net/#/files?id=file-locations

This may be irrelevant, but create a new Anki profile, copy-paste the following code in the Debug Console and press Ctrl+Return.

import locale
print('Default:', locale.getdefaultlocale())
print('Current:', locale.getlocale())
locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
print('New:', locale.getlocale())

https://docs.ankiweb.net/#/misc?id=debug-console

The output should be something like

Default: (‘en_US’, ‘cp65001’)
Current: (‘English_United States’, ‘utf8’)
New: (‘en_US’, ‘UTF-8’)

If the current locale is not utf8, add a new card with pronunciation_fr_tête_à_tête.mp3 and run Check Media. Maybe it’ll be different this time and report no unused or missing files.

1 Like

This is unexpected.

import locale
… print(‘Default:’, locale.getdefaultlocale())
… print(‘Current:’, locale.getlocale())
… locale.setlocale(locale.LC_CTYPE, ‘en_US.UTF-8’)
… print(‘New:’, locale.getlocale())
Default: (None, None)
Current: (None, None)
New: (‘en_US’, ‘UTF-8’)

Great. Maybe this is something relevant to the issue.

Once it’s been changed to UTF-8, try to add a new audio file, i.e.create a new Anki profile, rerun the same code again in the Debug Console to set UTF-8, add a new card, drag-and-drop pronunciation_fr_tête_à_tête.mp3, close the Add window and run Check Media. Maybe it’ll be different this time and report no unused or missing files.

That didn’t do it. I started with shift down, changed input to UTF-8, added a profile, created a card, download a new Forvo file and it didn’t work. Same error message in Media. But there is information.

  1. When I restart the app, it always says “none” for console input the first time I check. Changing “current" to UTF-8 does not stay.
  2. The file names are corrupted on my Mac when I download them. This is the name of the file in the Mac downloads folder.

pronunciation_fr_tête-à -tête-2.mp3

Is my Mac doing the corruption on download before I upload the file to Anki? I have tried both the U.S. keyboard and ABC Extended keyboard. I am in France.

Is my Mac doing the corruption on download before I upload the file to Anki?

Yes, maybe try a different web browser, but if you add it, Anki should still be able to find the audio file and play it.

Try to start Anki this way and run Check Media in a profile that contains one card to see if it makes any difference.