Class: TagLib::Ogg::Vorbis::File

Inherits:
File
  • Object
show all
Defined in:
docs/taglib/vorbis.rb

Overview

The file class for .ogg and other .oga files.

Examples:

Reading Vorbis comments

TagLib::Ogg::Vorbis::File.open("file.oga") do |file|
  tag = file.tag
  puts tag.title
  fields = tag.field_list_map
  puts fields['DATE']
end

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from File

#close, #save

Constructor Details

#initialize(filename, read_properties = true) ⇒ File

Load an Ogg Vorbis file.

Parameters:

  • filename (String)
  • read_properties (Boolean) (defaults to: true)

    if audio properties should be read



28
29
# File 'docs/taglib/vorbis.rb', line 28

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.

Parameters:

  • filename (String)
  • read_properties (Boolean) (defaults to: true)

    if audio properties should be read

Yields:

Returns:

  • the return value of the block

Since:

  • 0.4.0



20
21
# File 'docs/taglib/vorbis.rb', line 20

def self.open(filename, read_properties=true)
end

Instance Method Details

#audio_propertiesTagLib::Ogg::Vorbis::Properties

Returns audio properties.



40
41
# File 'docs/taglib/vorbis.rb', line 40

def audio_properties
end

#tagTagLib::Ogg::XiphComment

Returns the VorbisComment tag.



34
35
# File 'docs/taglib/vorbis.rb', line 34

def tag
end