lines2anki

AnkiWeb addon 835340270

Imports audio and lyric files from folders into Anki notes, letting users set provenance, deck, note type, fields, tags, and random images.
AI-generated summary; may contain mistakes.

card-creationimport

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
2 (πŸ‘ 2 Β· πŸ‘Ž 0)
Updated
2020-04-19
Anki versions
2.1.16~
Description language
en

Maintenance

abandoned

  • Last update or commit was 2326 days before the snapshot (2020-05-19).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.02.1.16+2020-04-19
History across monthly snapshots

Loading…

Similar addons

Anki Markdown Notes

Imports Markdown notes into Anki for Basic or Basic (and reversed) cards, using folder structure for decks, emphasizing Markdown-only editing and backups.

card-creationimportexport

Rating 1 πŸ‘ 0 Β· πŸ‘Ž 1 ⭐ 38 Anki 2.1.41~ Updated 2021-03-14
Marked import

Imports lines from a text file, creating notes with the marker-prefixed value if absent in the chosen deck, model, and field.

card-creationimport

Rating 0 πŸ‘ 0 Β· πŸ‘Ž 0 Anki 2.1.1~ Updated 2026-01-06

README

lines2anki

Anki add-on for importing lines of movie and TV series as new notes, composed by audio media and subtitle. You should prepare separated audio and lyric files previously, using tools such as Aboboo. Personally I write this add-on to import Aboboo sentence library.

Much thanks to hssm, from whom I mocked the structure of programme.

Link to add-on


This add-on will allow you to import audio files with lyric(.lrc) into your Anki collection, and use their filename as a component of the note.

When the add-on is installed, a Lines Import... option will be added to the Tools menu.

Menu

Before you do importing, you are supposed to organize the files first. Firstly put audio files as well as lyric files (with the same name) into the same folder. Rename the folder as the provenance of the audio. Optionally you can add several pictures into the folder, the add-on can select a random one from them as a part of the note.

We will use an example file tree like below:

Spam and Eggs
|___ ham-a.mp3
|___ ham-a.lrc
|___ ham-j.mp3
|___ eggs.jpeg

Back to Anki, selecting the menu item will open the Audio Import window.

SettingsWidget

From this window, you are able to:

  • Browse and select the folder where files are located
  • Change provenance
  • Choose which deck to import into
  • Choose which note type to use for the imported notes
  • Decide the content for each field
  • Add tags for all the imported notes

After accepted, all the audio and image files will be imported into media.collection, with standardized filename. New filename is composed by the provenance (which is the folder name by default, with all spaces replaced by dots) and timestamp (which makes the filename unique). Like this:

collection.media
|___ Spam.and.Eggs.audio(1)-1587037400.150538.mp3
|___ Spam.and.Eggs.audio(2)-1587037400.179473.mp3
|___ Spam.and.Eggs.image-1587037400.1434484.jpeg

Here is a list of the content available to insert into fields.

  • Filename : The name of the file including the extension (Spam.and.Eggs.audio-1587037400.150538(1).mp3)
  • Provenance : The origin of the lines, such as the title of movies. When you choose a new folder, it will be automatically changed to the folder's name (Spam and Eggs) You can also modify it manually.
  • Audio : The audio file itself ([sound:Spam.and.Eggs.audio(1).mp3])
  • Subtitle : The lyric that stored in .lrc files
  • Random Image : A random image file in the folder. (<img src="Spam.and.Eggs.image-1587037400.1434484.jpeg">)

All the new generated cards are added to the selected deck.

Complete

Developing Guidance

This is my very first try on writing Anki Add-ons. It's not that enjoyable but worth the time <(οΏ£οΈΆοΏ£)>

Developing Environment

  • Windows 10
  • Python 3.8
  • Anki 2.1
  • IDE: Pycharm, Visual Studio Code (used for viewing .log files)

Mistakes I've made

  1. To call the function when its signal triggered

    action = QAction("Voice Clips Import", mw)
    # Right
    action.triggered.connect(do_function)
    # Wrong
    action.triggered.connect(do_function())
    

Known issues

  • Media can't display properly on PC just after importation. Besides, the main window (deck list) freeze so that one cannot select a deck to study. These problems will gone after re-open anki.