3 0
Contact Author Sign in to rate

Convert AudioBooks to Anki (WIP)

<10kB. Updated 2020-05-30. Only supports Anki 2.1.x.
The author has shared 35 other item(s).

Description

The add-on is supposed to be a simple wrapper for aeneas to quickly synchronize text with audio - https://github.com/readbeyond/aeneas It's amazing, very fast and works very well most of the time! For example, aeneas had been used (with some corrections in Aegisub) to make the first chapter of Harry Potter and the Philosopher's Stone by J.K. Rowling in Anki - https://ankiweb.net/shared/byauthor/911275283 So far aeneas had been tested with English, Spanish, French, Italian, Arabic, Japanese, Russian, Dutch, Danish, German and Hungarian. Sometimes aeneas might generate subtitles completely out of sync or with a bit incorrect timings. Maybe it's something that can be improved with non-default settings or with a different TTS engine. Due to the memory limit, aeneas can only synchronize about 30 minutes of audio if it's installed on x86 machine and 1-2 or more hours of audio if it's installed with Python (64-bit) on x64 machine. IMPORTANT INFORMATION The add-on is yet to be made and released. At the moment the add-on doesn't have any code and will do nothing once it's installed. HOW TO USE WITHOUT THIS ADD-ON 1. Install aeneas - https://github.com/readbeyond/aeneas 2. Split text by sentences - http://textanalysisonline.com/nltk-sentence-segmentation 3. Synchronize text and audio with the following command or something similar. python -m aeneas.tools.execute_task "text.mp3" "text.txt" "task_language=en|is_text_type=plain|os_task_file_format=srt|task_adjust_boundary_nonspeech_min=0.250|task_adjust_boundary_nonspeech_string=REMOVE" "text.srt" 4. Import the audio file and subtitles with movies2anki using "movies2anki (subs2srs - audio)" note type - https://ankiweb.net/shared/info/939347702 HOW TO INSTALL ON WINDOWS For Windows, if it's installed on x64 machine with Python x64, the latest working version is 1.7.0 (pip install aeneas==1.7.0) and it should be possible to install it without any errors using "set AENEAS_WITH_CEW=False", i.e. set AENEAS_WITH_CEW=False pip install aeneas==1.7.0 For Windows x86, aeneas can also be installed with all-in-one installer - https://github.com/sillsdev/aeneas-installer/releases - and on Windows x64 too, but it'll be limited to ~30 minutes. I updated the above installer to Python x64 and it can be downloaded from https://github.com/kelciour/aeneas-installer/releases/tag/v1.7.0-x64 and everything can be installed in one click and it seems to work but it's not signed and Google Chrome with Windows Defender will give some warnings and it's recommended to install everything manually maybe in 10-15 minutes. 1. Install eSpeak in C:\Program Files (x86)\eSpeak and add it to the PATH environment variable. - https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md#manual-procedure-step-2-install-espeak 2. Download FFmpeg from https://ffmpeg.org/download.html#build-windows and update the PATH environment variable - https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md#manual-procedure-step-3-install-ffmpeg 3. Install Python 3.8 (Windows x86-64) from https://www.python.org/downloads/windows/ and check "Add Python 3.8 to PATH" in the installation settings. - https://docs.python.org/3.8/_images/win_installer.png 4. Open the Command Prompt app. - Open the Start menu or press the Windows key (⊞ Win) - cmd - Win+R - cmd - In the current folder by typing "cmd" in the address bar - https://lifehacker.com/quickly-open-a-command-prompt-from-the-windows-explorer-5989434 5. Copy-paste the following commands and press Enter (one by one/one at a time). python3 -m pip install numpy set AENEAS_WITH_CEW=False python3 -m pip install aeneas==1.7.0 python3 -m aeneas.diagnostics The last command will output something like this. [INFO] ffprobe OK [INFO] ffmpeg OK [INFO] espeak OK [INFO] aeneas.tools OK [WARN] shell encoding WARNING [WARN] The default input encoding of your shell is not UTF-8 [WARN] The default output encoding of your shell is not UTF-8 [INFO] If you plan to use aeneas on the command line, [INFO] you might want to 'set PYTHONIOENCODING=UTF-8' in your shell [INFO] aeneas.cdtw AVAILABLE [INFO] aeneas.cmfcc AVAILABLE [WARN] aeneas.cew NOT AVAILABLE [INFO] You can still run aeneas but it will be a bit slower [INFO] Please refer to the installation documentation for details [WARN] All required dependencies are met but at least one Python C extension is not available ADDITIONAL INFORMATION This is the third and maybe final add-on in the series of add-ons to import text with audio to Anki. 1. YouAlign/TMX Importer - https://ankiweb.net/shared/info/536046234 2. Batch Create Sentence Cards from Books - https://ankiweb.net/shared/info/1200382751 3. Convert AudioBooks to Anki POSSIBLE ALTERNATIVES As far as I'm aware, there's none, but please see the following post on Reddit how to make subtitles manually with Aegisub while listening to the audiobook or automatically synchronize text and audio with YouTube - https://www.reddit.com/r/Anki/comments/gra5ol/quick_way_of_adding_audiobook_with_matching_ebook/ If there're any questions, I might be slow to answer but would be happy to help. Nickolay <kelciour@gmail.com>

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

1885548963

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1620174920
Someone posted here already, but how did you do the Japanese one? https://ankiweb.net/shared/info/835702872

Aeneas gives me Language 'jpn' is not supported by the selected TTS engine
on 1611583865
Great idea, similar to the subtitle tools (like Subs2srs). I look forward to it.
on 1608076960
I successfully installed aeneas (one-installer-package). But I don't know where to paste mp3 and txt file.
Comment from author
At the moment it can be done by

- Opening a Command Prompt

https://lifehacker.com/quickly-open-a-command-prompt-from-the-windows-explorer-5989434

- Synchronizing text and audio with the following command or something similar

python -m aeneas.tools.execute_task "text.mp3" "text.txt" "task_language=en|is_text_type=plain|os_task_file_format=srt|task_adjust_boundary_nonspeech_min=0.250|task_adjust_boundary_nonspeech_string=REMOVE" "text.srt"