Automate Google translation & generation of Chinese/English Anki cards from a directory of mp3 files.
Creating Anki cards is not very fun.
- Fill a directory with mp3 files of chinese sentences/phrases/words.
- Make sure each file is named as per the speech:
files/
你好.mp3
我在学中文.mp3
- Create a service account in the Gcloud console with read access to the translate API.
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
pipenv install
pipenv python generate_from_mp3.py path/to/files
An anki package output.apkg
will be created in the current directory.
- Import the
apkg
file into Anki
Card css forked from u/TrainOfPotatoes post here