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 = TagLib::File::StripOthers) ⇒ Boolean
Save the file and the associated tags.
-
#strip(tags = TagLib::MPEG::File::AllTags) ⇒ Boolean
Strip the specified tags from the file.
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.
114 115 |
# File 'docs/taglib/mpeg.rb', line 114 def ape_tag? end |
#audio_properties ⇒ TagLib::MPEG::Properties
Returns audio properties.
54 55 |
# File 'docs/taglib/mpeg.rb', line 54 def audio_properties end |
#id3v1_tag(create = false) ⇒ TagLib::ID3v1::Tag?
Returns the ID3v1 tag.
40 41 |
# File 'docs/taglib/mpeg.rb', line 40 def id3v1_tag(create=false) end |
#id3v1_tag? ⇒ Boolean
Returns Whether or not the file on disk actually has an ID3v1 tag.
102 103 |
# File 'docs/taglib/mpeg.rb', line 102 def id3v1_tag? end |
#id3v2_tag(create = false) ⇒ TagLib::ID3v2::Tag?
Returns the ID3v2 tag.
48 49 |
# File 'docs/taglib/mpeg.rb', line 48 def id3v2_tag(create=false) end |
#id3v2_tag? ⇒ Boolean
Returns Whether or not the file on disk actually has an ID3v2 tag.
108 109 |
# File 'docs/taglib/mpeg.rb', line 108 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.
83 84 |
# File 'docs/taglib/mpeg.rb', line 83 def save(=TagLib::MPEG::File::AllTags, strip_others=TagLib::File::StripOthers) 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).
96 97 |
# File 'docs/taglib/mpeg.rb', line 96 def strip(=TagLib::MPEG::File::AllTags) end |