Audio::TagLib::Ogg::XiphComment - Ogg Vorbis comment implementation
use Audio::TagLib::Ogg::XiphComment; my $i = Audio::TagLib::Ogg::XiphComment->new(); $i->setGenre(Audio::TagLib::String->new("genre")); print $i->genre()->toCString(), "\n"; # got "genre"
This class is an implementation of the Ogg Vorbis comment specification, to be found in section 5 of the Ogg Vorbis specification. Because this format is also used in other (currently unsupported) Xiph.org formats, it has been made part of a generic implementation rather than being limited to strictly Vorbis.
Vorbis comments are a simple vector of keys and values, called fields. Multiple values for a given key are supported.
Constructs an empty Vorbis comment.
Constructs a Vorbis comment from $data.
Destroys this instance of the XiphComment.
Returns the number of fields present in the comment.
Returns a reference to the map of field lists. Because Xiph comments support multiple fields with the same key, a pure Map would not work. As such this is a Map of string lists, keyed on the comment field name.
The standard set of Xiph/Vorbis fields (which may or may not be contained in any specific comment) is:
qw(TITLE VERSION ALBUM ARTIST PERFORMER COPYRIGHT ORGRAIZATION DESCRIPTION GENRE DATE LOCATION CONTACT ISRC)
For a more detailed description of these fields, please see the Ogg Vorbis specification, section 188.8.131.52.
NOTE The Ogg Vorbis comment specification does allow these key values to be either upper or lower case. However, it is conventional for them to be upper case. As such, Audio::TagLib, when parsing a Xiph/Vorbis comment, converts all fields to uppercase. When you are using this data structure, you will need to specify the field name in upper case.
WARNING You should not modify this data structure directly, instead use addField() and removeField().
Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the most common case always returns "Xiph.Org libVorbis I 20020717".
Add the field specified by $key with the data $value. If $replace is true, then all of the other fields with the same key will be removed frist.
If the field value is empty, the field will be removed.
Remove the field specified by $key with the data $value. If $value is null, all of the fields with the given key will be removed.
Renders the comment to a ByteVector suitable for inserting into a file.
Renders the comment to a ByteVector suitable for inserting into a file. If $addFramingBit is true the standard Vorbis comment framing bit will be appended. However some formats (notably FLAC) do not work with this in place.
None by default.
Dongxu Ma, <email@example.com>
Copyright (C) 2005 by Dongxu Ma
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.