Writing byte data to tags

Glenn McCord glenn.mccord at gmail.com
Tue Aug 10 08:47:46 CEST 2010


Okay, thanks. I don't want to go abusing a specification.

I had a quick look at TagLibs ID3v2 headers. Am I right in thinking it
will be able to take that raw data and perhaps place it in a GEOB tag?






2010/8/10 Lukáš Lalinský <lalinsky at gmail.com>:
> On Tue, Aug 10, 2010 at 8:33 AM, Glenn McCord <glenn.mccord at gmail.com> wrote:
>> I'm trying to write an array of bytes to a xiphcomment tag. Something like:
>>
>> TagLib::FLAC::File f(path);
>> TagLib::Ogg::XiphComment *tag = f.xiphComment();
>>
>> TagLib::String s( TagLib::ByteVector( (char*)data, length ) );
>> tag->addField("CUSTOM_TAG", s);
>>
>> f->save();
>>
>> but the problem is that my array of bytes makes use of multiple null
>> bytes in a row. It seems that taglib will always interpret this as the
>> end of the string, meaning that only a fraction of my array gets
>> written to the file.
>>
>> With my (admittedly quick) look around the header files, it seems that
>> there is no way around this as there is a wide use of the String
>> class. Even FieldListMap seems to be using String.
>>
>> Is there a way to write raw bytes to a tag, or am I going to have to
>> modify some taglib code?
>
> Vorbis comments can contain only UTF-8 strings (according to the
> specification), anything else is invalid. So there is no way to store
> binary data, unless you use something like base64.
>
> Lukas
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
>


More information about the taglib-devel mailing list