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

Writing new comments #39

Open
sa7mon opened this issue Feb 8, 2021 · 2 comments
Open

Writing new comments #39

sa7mon opened this issue Feb 8, 2021 · 2 comments

Comments

@sa7mon
Copy link

sa7mon commented Feb 8, 2021

I'm attempting to add a SetComment method so I can write comment fields on v2 files. This is what I have so far and it almost works:

id3v2.go

func (t *Tag) SetComment(text string) {
	t.setTextFrameText(t.commonMap["Comments"], text)
}

then in testing:

file, err := id3.Open(filePath, false)
if err != nil {
	panic(err)
}

file.SetComment("this is my test comment with absolutely no special characters woohoo")

err = file.Close()
if err != nil {
	panic(err)
}

The ID3 spec defines the Comments frame as such:

<Header for 'Comment', ID: "COMM">
Text encoding           $xx
Language                $xx xx xx
Short content descrip.  <text string according to encoding> $00 (00)
The actual text         <full text string according to encoding>

It seems like the comment text is actually ending up in the "Short content description" portion instead of "the actual text".

I'd love any tips and I'll be sure to create a PR and share back my improvements when I get this working

@ghenry22
Copy link

@sa7mon did you have any luck with this? Looking at add exactly the same at the moment.

@sa7mon
Copy link
Author

sa7mon commented Oct 19, 2022

@ghenry22 Tbh I can't remember if I got this working or not. My fork of the repo is here. Relevant branches are master and dev. The repo I was using this library with is here

I did make a number of other changes including adding setDate() and setReleaseYear() as well as improvements in handling v2 vs v1 tags. It's been a while since I looked at this project, so memory is hazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants