arianneorpilla / jidoujisho

A full-featured immersion language learning suite for mobile.
GNU General Public License v3.0
819 stars 55 forks source link

Can't capture the subtitle' audio clip from pure audio files #335

Open boqxfjge opened 6 months ago

boqxfjge commented 6 months ago

When I create cards from the subtitles of audio files (mp3), the interface constantly stays on 'preparing images…', and can't to obtain the corresponding audio clip for the subtitle. Screenshot_20231228_230115_app lrorpilla yuuna

But at the same time, with video files, the subtitle's audio was captured very quickly. Screenshot_20231228_230046_app lrorpilla yuuna

Is it the absence of images in the audio file is hindering the process, and also preventing the capture of the audio? I don't need images, but I'm don't know how to bypass the 'preparing images' step.

siriuxy commented 6 months ago

I can reproduce this issue. Namely, mining an MP3 file with supplied subtitles (.srt) will lead to two kinds of failures:

Is there a way to see the logs to confirm the source of the issue? If the issue was indeed trying and failing to get an image from an audio file, a reasonable fix would be to avoid capturing image when playing subtitled audio files, and instead set currentSearchTerm to the current word.

@lrorpilla could you give me some code pointers on the logic of card creation, that distinguishes whether to fire up search for image, or to screenshot the current media? I'm not familiar with Dart/Flutter but would like to take a stab to fix this bug.

This project is absolutely awesome 👍

arianneorpilla commented 6 months ago

I think you can probably list the number of video tracks with the VLC controller, if there are no video tracks, then don't execute the get image logic.

You can probably find references to it in the CreatorPage