PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Read the tag from a file or create and Mp3Tag instance for saving tag to mp3 file later:
tag = Mp3Tag.new(filename)
tag.songname tag.artist tag.album tag.year tag.comment tag.tracknum tag.genre_id tag.genre
tag.songname = "My Song" tag.artist = "Me" tag.album = "My Album" tag.year = "2001" tag.comment = "No Comment" tag.tracknum = 3 tag.genre_id = 23 tag.genre = "Drum Solo"
genre_id's should exist in Mp3Tag::Genres. Elements in Mp3Tag::Genres can be assigned using tag.genre= and the id will be looked up automatically.
Saving tag to mp3:
Checking if a file has a tag:
Creates a new Mp3Tag object for the file give by path.
Tests if filename has a ID3V1.0 or ID3V1.1 tag. Returns a boolean values giving the result of the test.
Removes an ID3v1 tag from the MP3 file filename
Return the song name, artist, album, or comment from the tag as a String object. Will return empty strings if file did not have a tag.
Returns the track number from the tag. Will return 0 if the track number was not set in the tag when loaded, or if the file had no tag.
Returns the year from the tag. Will return 0 if the file had no tag.
Return the id number of the genre from the tag. Will return 255 if the file had no tag.
Returns the genre name. Will return "Unknown" if the file had no tag or the genre id was not in Mp3Tag::Genres
Returns the full path name of the MP3 file.
Returns the filename without the directory part of the MP3 File.
Sets the song name, atist, album, or comment for the tag to txt. txt should be a String object.
Sets the track number for the tag. Only values in the range (0..255) are allowed.
Sets the year for the tag. Should be a four digit number.
Sets the the genre id for the tag. Only values in the range (0..255) are allowed.
Sets the genre id for the tag to the index of txt in Mp3Tag::Genres. The genre id will be set to 255 if txt is not found in the list.
Saves the tag to the MP3 file. Will overwrite any existing tag.