.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MP3::Tag::ID3v1 3pm" .TH MP3::Tag::ID3v1 3pm "2009-11-28" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" MP3::Tag::ID3v1 \- Module for reading / writing ID3v1 tags of MP3 audio files .SH "SYNOPSIS" .IX Header "SYNOPSIS" MP3::Tag::ID3v1 is designed to be called from the MP3::Tag module. .PP .Vb 2 \& use MP3::Tag; \& $mp3 = MP3::Tag\->new($filename); \& \& # read an existing tag \& $mp3\->get_tags(); \& $id3v1 = $mp3\->{ID3v1} if exists $mp3\->{ID3v1}; \& \& # or create a new tag \& $id3v1 = $mp3\->new_tag("ID3v1"); .Ve .PP See MP3::Tag for information on the above used functions. .PP * Reading the tag .PP .Vb 7 \& print " Title: " .$id3v1\->title . "\en"; \& print " Artist: " .$id3v1\->artist . "\en"; \& print " Album: " .$id3v1\->album . "\en"; \& print "Comment: " .$id3v1\->comment . "\en"; \& print " Year: " .$id3v1\->year . "\en"; \& print " Genre: " .$id3v1\->genre . "\en"; \& print " Track: " .$id3v1\->track . "\en"; \& \& # or at once \& @tagdata = $mp3\->all(); \& foreach $tag (@tagdata) { \& print $tag; \& } .Ve .PP * Changing / Writing the tag .PP .Vb 10 \& $id3v1\->comment("This is only a Test Tag"); \& $id3v1\->title("testing"); \& $id3v1\->artist("Artest"); \& $id3v1\->album("Test it"); \& $id3v1\->year("1965"); \& $id3v1\->track("5"); \& $id3v1\->genre("Blues"); \& # or at once \& $id3v1\->all("song title","artist","album","1900","comment",10,"Ska"); \& $id3v1\->write_tag(); .Ve .PP * Removing the tag from the file .PP .Vb 1 \& $id3v1\->remove_tag(); .Ve .SH "AUTHOR" .IX Header "AUTHOR" Thomas Geffert, thg@users.sourceforge.net .SH "DESCRIPTION" .IX Header "DESCRIPTION" .IP "\fItitle()\fR, \fIartist()\fR, \fIalbum()\fR, \fIyear()\fR, \fIcomment()\fR, \fItrack()\fR, \fIgenre()\fR" 4 .IX Item "title(), artist(), album(), year(), comment(), track(), genre()" .Vb 12 \& $artist = $id3v1\->artist; \& $artist = $id3v1\->artist($artist); \& $album = $id3v1\->album; \& $album = $id3v1\->album($album); \& $year = $id3v1\->year; \& $year = $id3v1\->year($year); \& $comment = $id3v1\->comment; \& $comment = $id3v1\->comment($comment); \& $track = $id3v1\->track; \& $track = $id3v1\->track($track); \& $genre = $id3v1\->genre; \& $genre = $id3v1\->genre($genre); .Ve .Sp Use these functions to retrieve the date of these fields, or to set the data. .Sp \&\f(CW$genre\fR can be a string with the name of the genre, or a number describing the genre. .IP "\fIall()\fR" 4 .IX Item "all()" .Vb 2 \& @tagdata = $id3v1\->all; \& @tagdata = $id3v1\->all($title, $artist, $album, $year, $comment, $track, $genre); .Ve .Sp Returns all information of the tag in a list. You can use this sub also to set the data of the complete tag. .Sp The order of the data is always title, artist, album, year, comment, track, and genre. genre has to be a string with the name of the genre, or a number identifying the genre. .IP "\fIfits_tag()\fR" 4 .IX Item "fits_tag()" .Vb 1 \& warn "data truncated" unless $id3v1\->fits_tag($hash); .Ve .Sp Check whether the info in ID3v1 tag fits into the format of the file. .IP "\fIas_bin()\fR" 4 .IX Item "as_bin()" .Vb 1 \& $str = $id3v1\->as_bin(); .Ve .Sp Returns the ID3v1 tag as a string. .IP "\fIwrite_tag()\fR" 4 .IX Item "write_tag()" .Vb 1 \& $id3v1\->write_tag(); \& \& [old name: writeTag() . The old name is still available, but you should use the new name] .Ve .Sp Writes the ID3v1 tag to the file. .IP "\fIremove_tag()\fR" 4 .IX Item "remove_tag()" .Vb 1 \& $id3v1\->remove_tag(); .Ve .Sp Removes the ID3v1 tag from the file. Returns negative on failure, \&\s-1FALSE\s0 if no tag was found. .Sp (Caveat: only \fIone tag\fR is removed; some \- broken \- files may have many chain-loaded one after another; you may need to call \fIremove_tag()\fR in a loop to handle such beasts.) .Sp [old name: \fIremoveTag()\fR . The old name is still available, but you should use the new name] .IP "\fIgenres()\fR" 4 .IX Item "genres()" .Vb 3 \& @allgenres = $id3v1\->genres; \& $genreName = $id3v1\->genres($genreID); \& $genreID = $id3v1\->genres($genreName); .Ve .Sp Returns a list of all genres, or the according name or id to a given id or name. .IP "\fInew()\fR" 4 .IX Item "new()" .Vb 1 \& $id3v1 = MP3::Tag::ID3v1\->new($mp3fileobj[, $create]); .Ve .Sp Generally called from MP3::Tag, because a \f(CW$mp3fileobj\fR is needed. If \f(CW$create\fR is true, a new tag is created. Otherwise undef is returned, if now ID3v1 tag is found in the \f(CW$mp3obj\fR. .Sp Please use .Sp .Vb 2 \& $mp3 = MP3::Tag\->new($filename); \& $id3v1 = $mp3\->new_tag("ID3v1"); # Empty new tag .Ve .Sp or .Sp .Vb 3 \& $mp3 = MP3::Tag\->new($filename); \& $mp3\->get_tags(); \& $id3v1 = $mp3\->{ID3v1}; # Existing tag (if present) .Ve .Sp instead of using this function directly .SH "SEE ALSO" .IX Header "SEE ALSO" MP3::Tag, MP3::Tag::ID3v2 .PP ID3v1 standard \- http://www.id3.org .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2000\-2004 Thomas Geffert. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl.