1
0
Fork
You've already forked anki-gen
0
A script to generate audio for anki cards using COEROINK
  • Python 100%
Find a file
2025年05月01日 14:56:33 +03:00
.gitignore added requirements.txt 2025年05月01日 14:47:46 +03:00
anki_gen.py change filenames to hashes, fixes 'too long file name' error 2025年05月01日 14:56:33 +03:00
README.org updated readme 2025年03月16日 15:59:33 +02:00
requirements.txt added requirements.txt 2025年05月01日 14:47:46 +03:00

anki-gen - A script to generate audio for anki cards using COEROINK

Why?

Sometimes, Yomitan does not have the audio for a word. Other times, I am reading a manga or a Light Novel and add a new word, but the sentence does not have the sentence audio(duh). Coeroink with コシラズ(Koshikazu) seems like a decent solution, so I decided to automate it.

How do I use it?

  1. Download Coeroink & install it
  2. Download コシラズ & install it in the coeroink speakers folder.
  3. Download this script:

    • git clone https://codeberg.org/aeru/anki-gen
  4. We are going to need to do some quick settings, you should have Anki and the AnkiConnect plugin
  5. In anki-gen.py, edit

    COEROING_ENGINE_PATH = os.path.expanduser("~/downloads/COEIROINK_LINUX_CPU_v.2.7.1/engine/engine")
    COEROINK_URL = "http://localhost:50032/"
    anki_config = {
     "url":"http://localhost:8765/",
     "deck":"日本語::Mine",
     "fields": ["Word Audio:", "Sentence Audio:"],
     "extra": ["is:suspended","-tag:name"],
    }
    • COEROING_ENGINE_PATH Path to your Coeroink install + /engine/engine
    • in anki_config deck to the name of your anki deck
    • in anki_config fields to the fields that have audio (note: for it to properly work you need to have them be named with a space in between eg. your sentence "Sentence" and the audio field for it "Sentence Audio")
    • in anki_config extr to other query options, see Anki Wiki: Searching
  6. if you have nix installed, do chmod +x anki_gen.py, otherwise you need python3, and requests and pydub
  7. run ./anki-gen generate-all --speaker コシラズ --style ふきげん -o audio