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

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


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

#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


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

def id3v2_tag?
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