wahwah 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac83f92fa8a66210ab41b57ab7ccac87f7653573860286a5986ffc17132a57eb
4
- data.tar.gz: d197f0523c55af55ef826237b227e21d450b13937585eaa456e18360ae1983e6
3
+ metadata.gz: c89f381ce92eb4aef78be550c4d94ab8240aca8eb73668a3665ab4a13b1b4a05
4
+ data.tar.gz: f96620760e75d4675540394e6a09699872b882e9472b609ca9fa89461718bb2e
5
5
  SHA512:
6
- metadata.gz: d9e893bb99650e639f26546705d0d46bdba50da7377bd11f221247adc1069e97738ad2a4ed134fa078682ccf51cc13a37bf1bb2bebee3891e26de662e0f887cc
7
- data.tar.gz: 1bf025ffb3ef82c4870477402befafaedb5c1c654726ba77f61c88d7ef8d6516f6d56c79cf54fc45f319a56d97402f0061d8c5c0e20e3e274afc8d40080e4522
6
+ metadata.gz: aa56fddf36105d9ffe48174a448242c48e89473316d469589cfcfd6bd89dfa014b78a2ffac3b7b65cf0ff4afa75eb53ccb1114196f621828fecec4960f64ac36
7
+ data.tar.gz: a096bd36dd4a29d180faa55b6a06e4fbcb3ada6beb1592f37c15dfab84744c7f4850b5810620cc22909b76c30f75594a055eb11a55dec760c09c5a70c650332c
@@ -125,9 +125,22 @@ module WahWah
125
125
 
126
126
  mp4a_atom = atom.find("mp4a")
127
127
  esds_atom = atom.find("esds")
128
+ alac_atom = atom.find("alac")
128
129
 
129
130
  @sample_rate = mp4a_atom.data.unpack1("x22I>") if mp4a_atom.valid?
130
131
  @bitrate = esds_atom.data.unpack1("x26I>") / 1000 if esds_atom.valid?
132
+
133
+ # see https://github.com/macosforge/alac/blob/master/ALACMagicCookieDescription.txt for more info.
134
+ if alac_atom.valid?
135
+ atom_data = StringIO.new(alac_atom.data)
136
+
137
+ atom_data.seek(45, IO::SEEK_CUR)
138
+ @bit_depth = atom_data.read(1).unpack1("C")
139
+
140
+ atom_data.seek(10, IO::SEEK_CUR)
141
+ @bitrate = (atom_data.read(4).unpack1("I>") / 1000.to_f).round
142
+ @sample_rate = atom_data.read(4).unpack1("I>")
143
+ end
131
144
  end
132
145
 
133
146
  def parse_image_data(image_data_atom)
@@ -109,17 +109,18 @@ module WahWah
109
109
  # And INFO chunk as a subchunk for LIST chunk.
110
110
  if chunk.type != "INFO"
111
111
  chunk.skip
112
- else
113
- until list_chunk_end_position <= @file_io.pos
114
- info_chunk = Riff::Chunk.new(@file_io)
112
+ return
113
+ end
115
114
 
116
- unless INFO_ID_MAPPING.key? info_chunk.id.to_sym
117
- info_chunk.skip
118
- next
119
- end
115
+ until list_chunk_end_position <= @file_io.pos
116
+ info_chunk = Riff::Chunk.new(@file_io)
120
117
 
121
- update_attribute(info_chunk)
118
+ unless INFO_ID_MAPPING.key? info_chunk.id.to_sym
119
+ info_chunk.skip
120
+ next
122
121
  end
122
+
123
+ update_attribute(info_chunk)
123
124
  end
124
125
  end
125
126
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WahWah
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wahwah
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aidewoode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.21.2
75
+ version: 0.22.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.21.2
82
+ version: 0.22.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov-lcov
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -167,14 +167,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - ">="
169
169
  - !ruby/object:Gem::Version
170
- version: 2.6.0
170
+ version: 2.7.0
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.2.32
177
+ rubygems_version: 3.3.26
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Audio metadata reader ruby gem