-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse fails when files have multiple timestamps for single line of text #40
Comments
Thanks for report the issue! |
Awesome! Thanks for hopping on this so quickly Looking at the PR for the fix, would this result in the output being option 1 or option 2? Option 1 or Option 2 |
The result will be the option 1. |
And note that new NuGet package has been released! |
Cool. Just making sure I'm following. I've seen a lot of sites that use the multiple timestamps in a way that means option 2, but If that's not to the LRC standard, then option 1 makes the most sense. |
Guess this issue is fixed 🚀 |
@andy840119 in my opinion this is not the correct fix for the issue. |
https://en.wikipedia.org/wiki/LRC_(file_format) One is for sceeen text:
Another one is for karaoke format:
But (as i remember) some software might export the .lrc with those format as well:
Also, did you have idea for handling those cases? https://suwa.pupu.jp/RhythmicaLyrics.html |
I already took a look at the codebase and it likely requires some API changes. I'll try to come up with a PR over the weekend. |
I think in this case it should not repeat:
Did you have any idea for handle this case? Api change is OK for me, but would be better to explain why 👌🏼 |
This is taking abit longer than expected, but what I did up until now:
Looking at your post above I've got a question:
But according to your example it can also be this:
What are the timestamps in this case for? |
Just wanted to chime it that I had a user whose files contained lines in the format of |
https://github.com/karaoke-dev/sample-beatmap/blob/master/v1/%E6%9E%AF%E3%82%8C%E3%81%AA%E3%81%84%E8%8A%B1/lyric.lrc I' not sure if official |
@Chaphasilor already took care of that by extending the regex. @andy840119 seems like we need to differentiate between these layouts:
My plan is to convert all of these into the following object:
Always using the full timestamp for time and IndexState Start, for cases 1 and 2 we have no entry with IndexState End, for cases 3 and 4 we have |
Logic for knowing which of the above we are dealing with (based on regexing one line a time):
|
Maybe it's a good start:
|
Fine for me, will do so. |
There's not much documentation about .kar file format and maybe it's not as popular as .lrc file I think is's OK to treat it as official spec |
Because we need to adjust the lrc file format see: karaoke-dev#40
Since quite a few other projects are relying on this project to parse LRC (as its name indicates), it makes sense to maintain the functionality of LRC parsing in this lib and move the kar part to a seperate one like . BTW I was not able to find a PR on this created by @Shadowghost and wondering what's the current status of it. A service I'm using is relying on the above discussed items to be incorporated and would love to help! |
hmmmm.... @Shadowghost are you still interested on fixing this issue? I'll take over this issue if you have no time to fix it ;_; |
Sorry, I've been busy over the last weeks, I can push what I have if you want to take over. |
Nice, you can give me the branch and i can cherry-pick if possible to use 🙏🏼 |
Great! Being able to handle A2 extensions (word by word timestamps) and support millesecond timestamps [mm:ss.xxx] or <mm:ss.xxx> in A2 (as mentioned also by @Chaphasilor) is the most desired feature from the downstream projects. Appreciate your help. |
@andy840119 there you go: https://github.com/Shadowghost/LrcParser/tree/extend |
Because we need to adjust the lrc file format see: karaoke-dev#40
@1hitsong @Shadowghost @Reapor-Yurnero @Chaphasilor Here's the new release follow the .lrc format in the wiki 🎉 Only few changes and should be easy to adjust It's time to give it a try, report feedback is welcome ❤️ |
@andy840119 thanks for the update, working fine to far on my local tests. I do have one question though: What was the reason for you to not re-use the |
What does that means? |
I think I misunderstood what
by decoding the LRC (result would have all lines in the We don't actually need them but it would be nice for completeness to have them available somewhere |
That's called metadata, and i guess should make another parser for it (e.g.
I'm not sure what it's means (sorry for my bad english understanding), but e.g.
Lyric's start time will be [update] [update] |
Yes, that's what I mean with I misunderstood their usage 😅
Alternatively you could parse it in the existing parser and add a |
Personally I don't think it's very necessary to parse metadata in the lyrics. We can show them in the lyrics text but we don't need to parse it. Metadata should in the end be embedded in the music file itself rather than being double embedded in the lyrics. |
I think the next step might let LrcParser able to prese metadata, for prevent treating metadata as lyric text. |
In fact, i think it does have its merit to have some metadata shown in the lyrics such as composer, lyrics writer etc. which are typically not part of the music metadata itself. We may just skip these none timestamp brackets and do not parse them at all. |
Usually lyrics are not shared with the associated media file due to copyrights. Adding the metadata to the music file is therefore not really a valid argument.
That is already the case for synced lyrics. |
When attempting to parse a lyric file that has the following line, the parser failed.
[00:51.00][01:29.99][01:48.29][02:31.00][02:41.99]You gotta fight !
The expected outcome was for the parser to use the text "You gotta fight !" at each of the five time stamps.
The text was updated successfully, but these errors were encountered: