Class: TagLib::MPEG::File
Overview
The file class for .mp3
and other MPEG files.
Constant Summary collapse
- NoTags =
0x0000
- ID3v1 =
0x0001
- ID3v2 =
0x0002
- APE =
0x0004
- AllTags =
0xffff
Class Method Summary collapse
-
.open(filename, read_properties = true) {|file| ... } ⇒ Object
Creates a new file and passes it to the provided block, closing the file automatically at the end of the block.
Note that after the block is done, the file is closed and all memory is released for objects read from the file (basically everything from the
TagLib
namespace).Using
open
is preferable to usingnew
and then manuallyclose
.
Instance Method Summary collapse
-
#ape_tag? ⇒ Boolean
Whether or not the file on disk actually has an APE tag.
-
#audio_properties ⇒ TagLib::MPEG::Properties
Returns audio properties.
-
#id3v1_tag(create = false) ⇒ TagLib::ID3v1::Tag?
Returns the ID3v1 tag.
-
#id3v1_tag? ⇒ Boolean
Whether or not the file on disk actually has an ID3v1 tag.
-
#id3v2_tag(create = false) ⇒ TagLib::ID3v2::Tag?
Returns the ID3v2 tag.
-
#id3v2_tag? ⇒ Boolean
Whether or not the file on disk actually has an ID3v2 tag.
-
#initialize(filename, read_properties = true) ⇒ File
constructor
Load an MPEG file.
-
#save(tags = TagLib::MPEG::File::AllTags, strip_others = true) ⇒ Boolean
Save the file and the associated tags.
-
#strip(tags = TagLib::MPEG::File::AllTags) ⇒ Boolean
Strip the specified tags from the file.
-
#tag ⇒ TagLib::Tag?
Returns a tag that contains attributes from both the ID3v2 and ID3v1 tag, with ID3v2 attributes having precendence.
Methods inherited from File
Constructor Details
#initialize(filename, read_properties = true) ⇒ File
Load an MPEG file.
32 33 |
# File 'docs/taglib/mpeg.rb', line 32 def initialize(filename, read_properties=true) end |
Class Method Details
.open(filename, read_properties = true) {|file| ... } ⇒ Object
Creates a new file and passes it to the provided block, closing the file automatically at the end of the block.
Note that after the block is done, the file is closed and
all memory is released for objects read from the file
(basically everything from the TagLib
namespace).
Using open
is preferable to using new
and then
manually close
.
24 25 |
# File 'docs/taglib/mpeg.rb', line 24 def self.open(filename, read_properties=true) end |
Instance Method Details
#ape_tag? ⇒ Boolean
Returns Whether or not the file on disk actually has an APE tag.
122 123 |
# File 'docs/taglib/mpeg.rb', line 122 def ape_tag? end |
#audio_properties ⇒ TagLib::MPEG::Properties
Returns audio properties.
62 63 |
# File 'docs/taglib/mpeg.rb', line 62 def audio_properties end |
#id3v1_tag(create = false) ⇒ TagLib::ID3v1::Tag?
Returns the ID3v1 tag.
48 49 |
# File 'docs/taglib/mpeg.rb', line 48 def id3v1_tag(create=false) end |
#id3v1_tag? ⇒ Boolean
Returns Whether or not the file on disk actually has an ID3v1 tag.
110 111 |
# File 'docs/taglib/mpeg.rb', line 110 def id3v1_tag? end |
#id3v2_tag(create = false) ⇒ TagLib::ID3v2::Tag?
Returns the ID3v2 tag.
56 57 |
# File 'docs/taglib/mpeg.rb', line 56 def id3v2_tag(create=false) end |
#id3v2_tag? ⇒ Boolean
Returns Whether or not the file on disk actually has an ID3v2 tag.
116 117 |
# File 'docs/taglib/mpeg.rb', line 116 def id3v2_tag? end |
#save(tags = TagLib::MPEG::File::AllTags, strip_others = true) ⇒ Boolean #save(tags, strip_others, id3v2_version) ⇒ Boolean
Save the file and the associated tags.
91 92 |
# File 'docs/taglib/mpeg.rb', line 91 def save(=TagLib::MPEG::File::AllTags, strip_others=true) end |
#strip(tags = TagLib::MPEG::File::AllTags) ⇒ Boolean
Strip the specified tags from the file. Note that this directly updates the file, a call to save afterwards is not necessary (closing the file is necessary as always, though).
104 105 |
# File 'docs/taglib/mpeg.rb', line 104 def strip(=TagLib::MPEG::File::AllTags) end |
#tag ⇒ TagLib::Tag?
Returns a tag that contains attributes from both the ID3v2 and ID3v1 tag, with ID3v2 attributes having precendence.
40 41 |
# File 'docs/taglib/mpeg.rb', line 40 def tag end |