Permalink
Browse files

adding milliseconds

  • Loading branch information...
1 parent 0d97b6c commit 1852cad38982f526b6573b54278c734254977be1 @tenderlove committed Aug 1, 2008
Showing with 2 additions and 0 deletions.
  1. +1 −0 lib/icanhasaudio/mpeg.rb
  2. +1 −0 lib/icanhasaudio/mpeg/encoder.rb
View
@@ -8,6 +8,7 @@ class Audio::MPEG::Decoder
def initialize
@bits = 16
+ @raw = nil
yield self if block_given?
end
@@ -244,6 +244,7 @@ def parse_wave_header(file)
{
:num_channels => channels,
:in_samplerate => samples_per_sec,
+ :milliseconds => (data_length/2)/(samples_per_sec/1000)/2,
:num_samples => data_length / (channels*((bits_per_sample+7)/8)),
:bit_width => bits_per_sample,
}

0 comments on commit 1852cad

Please sign in to comment.