Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
460 stars 61 forks source link

Unable To Save Both Unsync and Sync Lyrics For Some Flac Files #224

Closed nlogozzo closed 1 year ago

nlogozzo commented 1 year ago

Hello again :)

As the title suggests there seems to be some issues with flac files containing both unsync and sync lyrics. For some files, it works and both can be stored together no problem. For others, both unsync and sync lyrics cannot be stored together (usually just unsync lyrics are saved and the sync lyrics get cleared).

Of course this is the code we are using to store lyrics is just:

track = new Track(Path);
track.Lyrics.LanguageCode = "eng";
track.Lyrics.Description = "lyric";
track.Lyrics.UnsynchronizedLyrics = "test";
track.Lyrics.SynchronizedLyrics.Add(new LyricsInfo.LyricsPhrase(timestamp, "A"));
track.Save();
track = new Track(Path); //reload

Here's a link to files to test: https://drive.proton.me/urls/9X6MJ66ES4#qI3QPdyCT7qi

Zeugma440 commented 1 year ago

Hey there,

=> We have two options there

1/ When writing to Vorbis or MP4/M4A tags, override unsynched lyrics when you set synched lyrics (which are richer by definition). They will get saved as LRC lyrics inside the dedicated field.

2/ Add a Setting to force ID3v2 tag creation when there's none inside the file

Any preference/suggestion?

nlogozzo commented 1 year ago

I guess nunber 1 would be best. Could we add a property to LyricsInfo maybe called SupportsBothUnsyncAndSync that we can set per tag type that way i can customize the UI based on whether a file supports both or not...

Zeugma440 commented 1 year ago

maybe called SupportsBothUnsyncAndSync that we can set per tag type that way i can customize the UI based on whether a file supports both or not...

Not sure that's where you want to go, knowing formats with a single lyrics field can very well support either of them (i.e. text block for unsynch or LRC for synch).

In terms of UI, I'd give the choice between Synched or Unsynched, but not give the option to edit both at the same time. Who wants to edit synched lyrics that contradict unsynched ones anyway?

nlogozzo commented 1 year ago

In terms of UI, I'd give the choice between Synched or Unsynched, but not give the option to edit both at the same time. Who wants to edit synched lyrics that contradict unsynched ones anyway?

Yeah that's true too....we'll go this route then

Zeugma440 commented 1 year ago

Available on today's v5.06