Class: TagLib::RIFF::AIFF::File

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

Overview

The file class for .aiff files.

Examples:

Reading the title

title = TagLib::RIFF::AIFF::File.open("sample.aiff") do |file|
  file.tag.title
end

Reading AIFF-specific audio properties

TagLib::RIFF::AIFF::File.open("sample.aiff") do |file|
  file.audio_properties.sample_width  #=>  16
end

Saving ID3v2 cover-art to disk

TagLib::RIFF::AIFF::File.open("sample2.aif") do |file|
  id3v2_tag = file.tag
  cover = id3v2_tag.frame_list('APIC').first
  ext = cover.mime_type.rpartition('/')[2]
  File.open("cover-art.#{ext}", "wb") { |f| f.write cover.picture }
end

See Also:

Since:

  • 0.7.0

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from File

#close, #save

Constructor Details

#initialize(filename, read_properties = true) ⇒ File

Load an AIFF file.

Parameters:

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

    if audio properties should be read

Since:

  • 0.7.0



41
42
# File 'docs/taglib/aiff.rb', line 41

def initialize(filename, read_properties=true)
end

Class Method Details

.open(filename, read_properties = true) {|file| ... } ⇒ Object

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.7.0



33
34
# File 'docs/taglib/aiff.rb', line 33

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

Instance Method Details

#audio_propertiesTagLib::RIFF::AIFF::Properties

Returns audio properties.

Returns:

Since:

  • 0.7.0



53
54
# File 'docs/taglib/aiff.rb', line 53

def audio_properties
end

#tagTagLib::ID3v2::Tag

Returns the ID3v2 tag.

Returns:

Since:

  • 0.7.0



47
48
# File 'docs/taglib/aiff.rb', line 47

def tag
end