Class: LAME::Decoding::DecodedFrame

Inherits:
Object
  • Object
show all
Defined in:
lib/lame/decoding/decoded_frame.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ DecodedFrame

Returns a new instance of DecodedFrame.



7
8
9
10
# File 'lib/lame/decoding/decoded_frame.rb', line 7

def initialize(left, right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



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

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



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

def right
  @right
end

Class Method Details

.from_short_buffers(left_buffer, right_buffer) ⇒ Object



12
13
14
15
16
17
# File 'lib/lame/decoding/decoded_frame.rb', line 12

def self.from_short_buffers(left_buffer, right_buffer)
  left  = left_buffer.read_array_of_short(left_buffer.size/2)
  right = right_buffer.read_array_of_short(right_buffer.size/2)

  new(left, right)
end

Instance Method Details

#samplesObject



19
20
21
# File 'lib/lame/decoding/decoded_frame.rb', line 19

def samples
  left.zip(right)
end