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

VorbisComment - Adding new Tag (keyvalue pair)? #43

Closed
HomerJau opened this issue Jan 11, 2018 · 4 comments

Comments

@HomerJau
Copy link

commented Jan 11, 2018

I'd like to add a new (non standard in flaclibsharp) tag to a FLAC file for storing replaygain data (requires multiple replaygain tags).

flaclibsharp can read those non-standard replaygain tags if they exist in a flac ok.

However there does not seem to be a way to create new tags or update non-standard tags.

Is it possible for you to add methods to:
Add a new key & value (example "replay_gain-track_gain=-2.50 db")
Update a non-standard tag (example "replay_gain-track_gain=-2.50 db")

Question:
Will the existing VorbisComment .save method support saving new tags without trashing the file? (if I go ahead and modify flaclibsharp to allow new VorbisCommentvalues)

THX

@AaronLenoir

This comment has been minimized.

Copy link
Owner

commented Jan 13, 2018

Hello

Thanks for you interest! Hopefully we can find a solution for you.

I have some questions:

  • Am I correct in assuming the replay_gain-track_gain are Vorbis Comment Tags? Or are we talking about something else, like custom FLAC metadata.
  • Do you have an experience where the Save method for the VorbisComment trashes the file? Can you provide an example (perhaps in a seperate github issue)?

I believe adding (multiple) tags can be done as follows.

However: I just tried this and when reading I only get one of the values back for that tag! So I think there's a bug I will need to investigate as soon as I have some time.

Have you tried the following?

            // Add multiple vorbis comment tags
            using (FlacFile file = new FlacFile(@"Data\testfile1.flac"))
            {
                if (file.VorbisComment == null)
                {
                    file.Metadata.Add(new VorbisComment());
                }

                file.VorbisComment["replay_gain-track_gain"] = new VorbisCommentValues(new string[] { "-2.50 db", "-3.50 db" });

                file.Save();
            }

@AaronLenoir AaronLenoir added the bug label Jan 13, 2018

@AaronLenoir AaronLenoir self-assigned this Jan 13, 2018

@HomerJau

This comment has been minimized.

Copy link
Author

commented Jan 14, 2018

@HomerJau

This comment has been minimized.

Copy link
Author

commented Jan 15, 2018

@AaronLenoir

This comment has been minimized.

Copy link
Owner

commented Jan 15, 2018

Good to hear you got something to work. Sorry the API wasn't more clear. I made two issues to address the things we've found here: #44 and #45
Feel free to add some comments there if I missed something. I may try to ask you some questions when I work on it.

I'll close this one since your original problem was solved.

I'm glad to hear you are finding this project useful. I'm curious to know what you're using it for, if you feel like sharing that.

Talk to you later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.