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



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

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



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

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

Instance Method Details

#audio_propertiesTagLib::RIFF::AIFF::Properties

Returns audio properties.

Returns:

Since:

  • 0.7.0



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

def audio_properties
end

#id3v2_tag?Boolean

Returns Whether or not the file on disk actually has an ID3v2 tag.

Returns:

  • (Boolean)

    Whether or not the file on disk actually has an ID3v2 tag.

Since:

  • 1.0.0



58
59
# File 'docs/taglib/aiff.rb', line 58

def id3v2_tag?
end

#tagTagLib::ID3v2::Tag

Returns the ID3v2 tag.

Returns:

Since:

  • 0.7.0



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

def tag
end