icanhasaudio 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,8 @@
1
+ === 0.1.3
2
+
3
+ * Bugfix
4
+ * Some IOs do not respond to path, so bitrate can not be file size based.
5
+
1
6
  === 0.1.2
2
7
 
3
8
  * Bugfix
@@ -35,7 +35,6 @@ module Audio
35
35
  def skip_id3_header input
36
36
  header = input.read(4)
37
37
  if header == ID3
38
- puts "asdfadsf"
39
38
  id3_len = input.read(6).unpack('C*')[2..-1].map { |chr|
40
39
  chr & 127
41
40
  }.inject(0) { |total,chr|
@@ -47,7 +46,7 @@ module Audio
47
46
  raise "Found AiD header" if header == AID
48
47
 
49
48
  while !syncword_mp123?(header)
50
- header = header.slice(1..-1) + input.getc
49
+ header = header.slice(1..-1) + input.getc.chr
51
50
  end
52
51
  header
53
52
  end
@@ -84,6 +83,7 @@ module Audio
84
83
  end
85
84
 
86
85
  def determine_samples_for infile
86
+ return unless infile.respond_to?(:path)
87
87
  length = File.stat(infile.path).size
88
88
  total_seconds = length * 8.0 / (1000.0 * mp3data.bitrate)
89
89
  self.num_samples = (total_seconds * in_samplerate).to_i
@@ -1,7 +1,7 @@
1
1
  module Audio
2
2
  module MPEG
3
3
  class Decoder
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icanhasaudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-28 00:00:00 -07:00
12
+ date: 2008-10-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency