Class: LAME::Decoder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/lame/decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mp3_file) ⇒ Decoder

Returns a new instance of Decoder.



9
10
11
12
13
14
15
# File 'lib/lame/decoder.rb', line 9

def initialize(mp3_file)
  @decode_flags = FFI::DecodeFlags.new
  @mp3_file = mp3_file

  skip_id3_tag
  @mp3_data = parse_mp3_data
end

Instance Attribute Details

#decode_flagsObject (readonly)

Returns the value of attribute decode_flags.



5
6
7
# File 'lib/lame/decoder.rb', line 5

def decode_flags
  @decode_flags
end

#mp3_dataObject (readonly)

Returns the value of attribute mp3_data.



5
6
7
# File 'lib/lame/decoder.rb', line 5

def mp3_data
  @mp3_data
end

#mp3_fileObject (readonly)

Returns the value of attribute mp3_file.



5
6
7
# File 'lib/lame/decoder.rb', line 5

def mp3_file
  @mp3_file
end

Instance Method Details

#each_decoded_frameObject



17
18
19
20
21
# File 'lib/lame/decoder.rb', line 17

def each_decoded_frame
  stream_decoder.each_decoded_frame do |decoded_frame|
    yield decoded_frame
  end
end