Skip to content
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

Incorrect ID3 synchronized lyrics (SYLT) data. #2134

Closed
probityrules opened this issue Jun 18, 2024 · 6 comments · Fixed by #2159
Closed

Incorrect ID3 synchronized lyrics (SYLT) data. #2134

probityrules opened this issue Jun 18, 2024 · 6 comments · Fixed by #2159
Labels
bug Bug, will addressed with high priority

Comments

@probityrules
Copy link

When I use this library to parse synchronized lyrics from an mp3, I get a single array with corrupted data like this:

//common.lyrics
[
    "揾愀瀀琀椀漀渀猀",
    "Check out your sash!",
    "",
    "揾愀瀀琀椀漀渀猀",
    "Check out your sash!",
    "",
    "泾椀瀀猀礀渀挀",
    "X",
    "＀䛾",
    "渀C",
    "8䛾",
    "币B",
    "P䏾",
    "瘂B",
    "ᅯ壾",
    "怄"
]

But in this example it should be a 2d array (3 arrays of synchronized lyric data) with data something along these lines (per https://id3.org/id3v2.3.0#Synchronised_lyrics.2Ftext):

[{
    "language": "eng",
    "timeStampFormat": 2,
    "contentType": 2,
    "shortText": "captions",
    "synchronisedText": [{
        "text": "Check out your sash!",
        "timeStamp": 9
    }]
}, {
    "language": "eng",
    "timeStampFormat": 2,
    "contentType": 2,
    "shortText": "captions",
    "synchronisedText": [{
        "text": "Check out your sash!",
        "timeStamp": 9
    }]
}, {
    "language": "eng",
    "timeStampFormat": 2,
    "contentType": 0,
    "shortText": "lipsync",
    "synchronisedText": [{
        "text": "X",
        "timeStamp": 0
    }, {
        "text": "F",
        "timeStamp": 110
    }, {
        "text": "C",
        "timeStamp": 280
    }, {
        "text": "F",
        "timeStamp": 350
    }, {
        "text": "B",
        "timeStamp": 560
    }, {
        "text": "C",
        "timeStamp": 630
    }, {
        "text": "B",
        "timeStamp": 980
    }, {
        "text": "X",
        "timeStamp": 1120
    }]
}]

(I realize the first two repeat which is an error on my end and doesn't match the last line of the spec:

There may be more than one "SYLT" frame in each tag, but only one with the same language and content descriptor.

but it does exhibit the issue of not correctly unpacking a list of multiple synchronized lyric sets.

@Borewit Borewit transferred this issue from Borewit/music-metadata-browser Jul 10, 2024
@Borewit
Copy link
Owner

Borewit commented Jul 11, 2024

Please provide a sample.

@Borewit Borewit added the cannot reproduce The issue described cannot be reproduced label Jul 11, 2024
@probityrules
Copy link
Author

probityrules commented Jul 12, 2024

Here's an mp3 with two embedded SYLT's - "captions" and "lipsync"
menu-sash.zip

@Borewit Borewit added bug Bug, will addressed with high priority and removed cannot reproduce The issue described cannot be reproduced labels Jul 19, 2024
@Borewit
Copy link
Owner

Borewit commented Jul 19, 2024

Issue confirm, there are number of shortcomings and limitations in the ID3v2 SYLT frame decoding.

@Borewit
Copy link
Owner

Borewit commented Jul 19, 2024

I have difficulties to detect the difference between shortText and synchronisedText

@probityrules
Copy link
Author

The shortText/descriptor would be a variable-size string that terminates with 0x00 and if it's an empty, it's just a standalone 0x00. In both cases after the 0x00 is the first synchronized text (ie a another variable-size string terminated by 0x00) and timestamp (32bit I think), which then repeats (string, timestamp, string, timestamp) until end of frame.

@Borewit
Copy link
Owner

Borewit commented Jul 20, 2024

Got it, first portion is shortText / Content descriptor, terminated by $00 / $0000
After that a list synchronisedText / syllable, terminated by $00 / $0000, and each entry followed by timestamp $XXXX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, will addressed with high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants