Anki fails to play audio files from my flashcard set that work fine on the desktop app. The files come from my course notes, and they weren’t encoded by me.
This is a file encoded by me, and works in AnkiMobile:
I then added test.mov and test.m4a to an Anki note.
In Mac desktop Anki app, when browsing and previewing the note’s cards, both files autoplay. (A window appears, the video plays in the window, and then the window disappears. This happens for both files in sequence. Also, play buttons are seen on the card.)
In iPhone AnkiMobile app, when browsing and previewing the note’s cards, the .mov file appears and autoplays. (The video apppears on the card and autoplays. The video has media control buttons, including a play button.) However, the .m4a file does not play. (A play button appears on the card, but pressing the button results in an error dialog.)
Error playing audio. This can be caused by a corrupt file, a file iOS does not support (eg. ogg), or an mp3 file incorrectly named .wav
test.m4a: Error Domain=NSOSStatus-ErrorDomain Code=1954115647 "(null)"
I suggest that you try some testing: Rename your unit_3.2_5.m4a file to unit_3.2_5.mov and also change it on a corresponding Anki card. See if Anki behaves differently with the renamed file.
(If the problem is a misnamed file, then I’m not sure if this would be considered a bug, strictly-speaking? I’m not sure if AnkiMobile has an obligation to handle misnamed media files even if desktop Anki is able to do so?)
This is basically a bug. I believe the files are old, and they use an encoding scheme that existed before m4a which is to make an mp4 with no video data. It’s a valid encoding, and it basically works everywhere except for ios (and maybe android???).
But, the fact is that this creates a parity error between these platforms. And, right now, Anki (the app) does nothing and gives you no option. It doesn’t warn you. It doesn’t make a suggestion. It doesn’t convert the files for you. It only gives a generic error toast when and if it fails.
AnkiMobile relies on iOS functionality to play media. If iOS doesn’t support the filetype, then you won’t be able to use it in AnkiMobile. This can’t be fixed in the app – you’ll have to fix the files themselves.