class ID3::AudioFile
ID3-tags can be attached to more than just MP3-files, that's why
AudioFile has no knowledge about the MP3-standard. If you want to
include it, you can derive your own class and add that functionality.
Provided Functionality:
- Reads and parses audio files for ID3-tags
- Writes audio files and attaches ID3-tags to them
- Keeps track of complete path name to audio file
- Keeps track of where the raw audio portion of an audio-file is
- Top-level interface to ID3-tags
Instance Variables:
- pwd , filename #
working directory and path/name of the file when it was opened..
- dirname, basename # absolute dirname and basename of the file
- tagID3v1 , tagID3v2 # the ID3-tags , if not present these are nil
# should they be renamed to tag1 and tag2 ?
Instance Methods:
- new
- audioMD5sum
- writeMD5sum
- verifyMD5sum
- version / versions
Examples:
> a = ID3::AudioFile.new("mp3/a.mp3")
=> #<ID3::AudioFile:0x402714ec @pwd="/home/tilo/Ruby/ID3", @tagID3v1={"ARTIST"=>"Wolfsheim", "ALBUM"=>"", "TITLE"=>"Sleep Somehow", "YEAR"=>"", "GENREID"=>"255", "COMMENT"=>""}, @audioMD5sum=nil, @filename="mp3/a.mp3", @basename="a.mp3", @audioEndX=1433600, @dirname="/home/tilo/Ruby/ID3/mp3", @audioStartX=1418, @tagID3v2={"ARTIST"=>{"encoding"=>0, "text"=>"Wolfsheim"}, "SONGLEN"=>{"encoding"=>0, "text"=>"193567"}, "CONTENTTYPE"=>{"encoding"=>0, "text"=>"newage"}, "ALBUM"=>{"encoding"=>0, "text"=>"Spectators"}, "TRACKNUM"=>{"encoding"=>0, "text"=>"6"}, "TITLE"=>{"encoding"=>0, "text"=>"Sleep Somehow"}, "MEDIATYPE"=>{"encoding"=>0, "text"=>"DIG"}}>
> a.version
=> "1.0 2.3.0"
> a.tagID3v1
=> {"ARTIST"=>"Wolfsheim", "ALBUM"=>"", "TITLE"=>"Sleep Somehow", "YEAR"=>"", "GENREID"=>"255", "COMMENT"=>""}
> a.tagID3v2
=> {"ARTIST"=>{"encoding"=>0, "text"=>"Wolfsheim"}, "SONGLEN"=>{"encoding"=>0, "text"=>"193567"}, "CONTENTTYPE"=>{"encoding"=>0, "text"=>"newage"}, "ALBUM"=>{"encoding"=>0, "text"=>"Spectators"}, "TRACKNUM"=>{"encoding"=>0, "text"=>"6"}, "TITLE"=>{"encoding"=>0, "text"=>"Sleep Somehow"}, "MEDIATYPE"=>{"encoding"=>0, "text"=>"DIG"}}