incidentist / the_tuul

Make a decent karaoke video from any song in about 10 minutes.
https://the-tuul.com
17 stars 4 forks source link

Lyric timings disable Submit button #24

Open incidentist opened 10 months ago

incidentist commented 10 months ago

Sometimes, the song timing process throws an error in the console indicating that the timings can't be turned into an .ass file for some reason. This prevents the Submit tab from enabling, which prevents the video from being created. No error is shown to the user, so it's a frustrating experience. The repro conditions are currently unclear.

incidentist commented 10 months ago

To repro with these lyrics:

hey hey screen 1

hey ho screen 2
  1. Navigate to Song Timing and press Start. Press spacebar at t=1, enter at t = 5, spacebar at t = 7.
  2. Click "redo previous screen". This rewinds the "playhead" by 10 seconds, so let's say it's now at t = 0.
  3. Hit spacebar at t = 4.

This will display an error:

vue.esm.js:3767 Error: Negative line startTime: [object Object]: -8
    at LyricsLine.decorateAssLine (timing.ts:246:13)
    at LyricsLine.toAssEvent (timing.ts:274:18)
    at timing.ts:180:39
    at Array.map (<anonymous>)
    at LyricsScreen.toAssEvents (timing.ts:180:23)
    at createSubtitles (timing.ts:416:23)
    at createAssFile (timing.ts:441:10)
    at VueComponent.subtitles (SubmitTab.vue:73:27)
    at Watcher.get (vue.esm.js:4164:1)
    at Watcher.evaluate (vue.esm.js:4265:1)

That's because the start timestamp of screen 2 is before the end timestamp of screen 1.

Options:

  1. Disable the spacebar until the playhead is after the most recent timing.
  2. Ensure that timestamps are always monotonically increasing, and if a timestamp comes in that is earlier than the most recent timestamp...adjust the most recent timestamp, I guess?
  3. Could also do this at the ass-generation stage, which is when the error is occurring. This is more true to the spirit of the timings, which are supposed to be the non-altered times that the user entered timings, even if they don't make sense.

I'm going with #2.