mpatric / mp3agic

A java library for reading mp3 files and reading / manipulating the ID3 tags (ID3v1 and ID3v2.2 through ID3v2.4).
MIT License
1.2k stars 310 forks source link

Embedded lyric timeline was stripped off #170

Closed andj207 closed 4 years ago

andj207 commented 4 years ago

I have edited my mp3 file to add lyric using Mp3nity and playback with Windows Media Player (lyric plugin MiniLyrics). The lyrics show and sync with player's progress correctly. But when using mp3agic to read the lyric in my Android app, the lyric timeline does not present in the result string

Lost in your mind
I wanna know
..... and more lines

The lyric should be:

[length: 02:43.32]
[re:www.megalobiz.com/lrc/maker]
[ve:v1.2.3]
[00:04.62]Lost in your mind
[00:10.63]I wanna know
[00:13.87]Am I losing my mind?
[00:20.87]Never let me go
.....

my Kotlin code:

val mp3File = Mp3File(mp3FilePath)
val lyrics = if (mp3File.hasId3v2Tag()) {
            mp3File.id3v2Tag.lyrics ?: ""
        }
        else ""

How can I read the mp3's lyric and keep the timeline?

andj207 commented 4 years ago

My bad, Mp3nity has embedded an unsynced lyric. So, close the issue.