Way to export sentences with respective audio parts to anki cards?

Hey all,

I can’t find a good way to turn my single audio file to Anki cards. It is important to me as all AI voices miss proper Danish pronunciation.

However, LingQ does a great job of splitting my audio file into words/sentences/phrases in sentence view, and I would like to export that anki. Does anyone know a way?

Additionally, does anyone know a way to save LingQs vocabulary/phrases in Lingq with original audio instead of TTS voice?

Can be done fairly easily in the browser with the Web Audio APIWeb Audio API - Web APIs | MDN

You can utilize the LingQ API from your logged in account to retrieve the url to the audio file as well as the sentence timestamps (within the tokenized text). From this data you could infer the word timestamps in a decent number of languages using an estimation function.

If you wanted to use something more powerful than the browser I would look at FFMPEG and converting the LingQ data into something usable.

Example Lesson API URL
https://www.lingq.com/api/v3/fi/lessons/36639634/simple/

fi being the language code and 36639634 being the lesson id. You can find these in the URL of the lesson.

image

There appears to be a field to save an audio URL. I am speculating that the splitting of each word into an audio file is probably more data intensive than the LingQ team would like. When reviewing the sentence they just move to the correct space in the audio, there is no sentence audio fragment saved anywhere.


Splitting the audio by sentence is a feature in MasterLingQ & Rooster Video Tools but those are both paid solutions.

2 Likes

Thanks a lot! That is exactly what I needed.

I used API to get JSON, then asked ChatGPT to create a python script for FFMPEG to cut the audio and build a nice table with sentences, translations and audios for each and works like a charm.

1 Like

So theres no way to quickly save the audio file of a specific sentence since the audio file sentence fragment doesnt exist?

Only through the way described with manipulating the audio based on timestamps and using the Web API or FFMPEG.

Examples with Rooster Extensions

On Video Website (With Rooster Video Tools Addon)

image


On LingQ Website (With MasterLingQ Addon) - Only if Lesson has AUDIO

image

image

Okay so with the masterlingq extension the “audio_slice” files correspond to the sentences?
As in “audio_slice_17” = sentence 17/20 in lingq sentence mode?

That’s right. The sentence/translation/timestamps and other data are in a different folder.

1 Like