Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I bulk import audio (.mp3/.wav etc) data to an Anki deck?

Tags:

java

csv

anki

There is an import feature on Anki that allows the user to import their CSV files saved in UTF-8 encoding, which the program later converts to .akpg files.

I would like to add sounds (ideally .mp3 audio) to each flashcard of my deck, which doesn't seem possible using those CSV files.

Is there a solution to this issue that does not involve programmatically generating the .apkg? And if not, how can I write a program to do so (preferably in Java)?

like image 275
Charles Reis Ribeiro Avatar asked Sep 17 '25 14:09

Charles Reis Ribeiro


2 Answers

As far as I know (and used) you can just:

  • use a phrase like "[sound:FILE1.mp3]" inside your card's text and import such a .TXT/.CSV into your deck
  • copy all needed media files (here: FILE1.mp3) into your anki's "collection.media" folder (take care to avoid name collisions - it looks all the media files are stored together so using a name prefix common for your batch would be sensible)

That should be enough to get your audio played during learning.

You can then export the deck having "with media" option checked to have it packaged nicely into .apkg to use it elsewhere (import is intelligent enough to rename imported media files so users of such a package need not to worry about name collisions).

like image 90
woj Avatar answered Sep 20 '25 06:09

woj


I'm going to go out on a limb here and assume that you are attempting to add pronunciations to a language-focused deck. If this is the case, you could sidestep your problem using the AwesomeTTS Anki addon. This addon allows you to bulk generate sound files based on a field in existing cards, using a number of text-to-speech services.

like image 36
Geoff Avatar answered Sep 20 '25 06:09

Geoff