Hi,
I'm not sure where patches should be sent, so please re-direct me if this is not the best place.
I've been writing a small program to help me convert ID3 tags from Big5 encoding to UTF-8 and libid3tag has made it _really_ easy. The API is so much cleaner than id3lib :)
Anyway, I came across a bug which prevented me from fetching the text encoding value using id3_field_getint() from a field of type ID3_FIELD_TYPE_TEXTENCODING. Here is a simple one-liner to fix this behaviour. I hope it can be included in the next version.
On another note, is there anyone who has python bindings for libid3tag? If not, I'd probably spend a little time writing some.
Cheers,
On Monday, October 6, 2003, at 01:50 PM, Alastair Tse wrote:
Anyway, I came across a bug which prevented me from fetching the text encoding value using id3_field_getint() from a field of type ID3_FIELD_TYPE_TEXTENCODING. Here is a simple one-liner to fix this behaviour. I hope it can be included in the next version.
Thanks for your patch.
I suppose it was an oversight not to provide an accessor routine for the text encoding field, but in practice it's usually not important because libid3tag uses the field internally to provide UCS-4 strings regardless of the original encoding.
For the next release I will add an id3_field_gettextencoding() routine.
Cheers,
On Mon, Oct 06, 2003 at 09:50:11PM +0100, Alastair Tse wrote:
On another note, is there anyone who has python bindings for libid3tag? If not, I'd probably spend a little time writing some.
Actually, I just made some basic ones last week.
http://www.superduper.net/index.py?page=pyid3tag
Its just a start. Let me know how you get on, i'd love some help on it.
sam
On Sun, 2003-10-12 at 20:16, sam@superduper.net wrote:
On Mon, Oct 06, 2003 at 09:50:11PM +0100, Alastair Tse wrote:
On another note, is there anyone who has python bindings for libid3tag? If not, I'd probably spend a little time writing some.
Actually, I just made some basic ones last week.
http://www.superduper.net/index.py?page=pyid3tag
Its just a start. Let me know how you get on, i'd love some help on it.
I actually didn't get a reply so I thought no one was working on it. So as an exercise to learn how SWIG works, I made some as well :) I forgot to announce it or anything. I think the bindings are pretty complete except for id3_tag_render(). I don't understand how to tell how much buffer to give to render a tag or if it allocates the memory for you.
http://www-lce.eng.cam.ac.uk/~acnt2/code/
Maybe we could combine our efforts somehow.
Cheers,
On Sunday, October 12, 2003, at 03:22 PM, Alastair Tse wrote:
I think the bindings are pretty complete except for id3_tag_render(). I don't understand how to tell how much buffer to give to render a tag or if it allocates the memory for you.
The way it works is like this: First call id3_tag_render() with a null buffer argument. It will return the maximum possible size of the rendered tag (without actually rendering yet). Then allocate your buffer using this size and pass it to the routine again, and this time the tag will be rendered in your buffer and the actual size returned. The actual size may be smaller than the original estimate, but it will never be larger.
Cheers,
On Sun, Oct 12, 2003 at 11:22:12PM +0100, Alastair Tse wrote:
I actually didn't get a reply so I thought no one was working on it. So as an exercise to learn how SWIG works, I made some as well :) I forgot to announce it or anything. I think the bindings are pretty complete except for id3_tag_render(). I don't understand how to tell how much buffer to give to render a tag or if it allocates the memory for you.
http://www-lce.eng.cam.ac.uk/~acnt2/code/
Maybe we could combine our efforts somehow.
Cool, your wrappers look more comprehensive than mine. Although mine are object oriented and very simple.
tag = Id3Tag.ItdTag("an.mp3") print tag.Artist print tag.GetFrame("TIT2")
Maybe my set of OO wrappers could be added on top of yours? I'll give them a try today
cheers, sam