nu_wav 0.5.1 → 0.5.2
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.
- checksums.yaml +4 -4
- data/{README.rdoc → README.md} +4 -4
- data/lib/nu_wav/version.rb +1 -1
- data/lib/nu_wav/wave_file.rb +1 -1
- data/nu_wav.gemspec +1 -0
- data/test/files/bext_rf64.wav +0 -0
- data/test/test_nu_wav.rb +38 -0
- metadata +29 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae6cd918a153bd8d42624454930918744cc97e11
|
4
|
+
data.tar.gz: ccac0689b07bac03986e5ed2fed094784535cad8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9171eafa8a246d3628df246fc3eaf3e9b858517e94a027b9c1b9416a9e3fe3f005d3f2e3ed74175394469f97e425b59572e1ff0a5201b474ce6bca82517a0b27
|
7
|
+
data.tar.gz: 0abbe49eaa6a9b471fbfa56cac07afd8b04fc53c13cbd8a43522f845a13e1ed96419d5abf974c65d65d4288a1d2a8908450d710d8946391ccfba0307a99c165e
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# NuWav Ruby Gem (nu_wav)
|
2
2
|
|
3
3
|
[](https://travis-ci.org/kookster/nu_wav)
|
4
4
|
|
@@ -9,7 +9,7 @@ It will parse other chunks, but doesn't necessarily provide specific parsing for
|
|
9
9
|
|
10
10
|
It will look for a class based on the chunk name, so if you want to add 'fact' chunk parsing, you need to define a class like this (n.b. 'fact' chunks are already supported, this is an example from the code):
|
11
11
|
|
12
|
-
```
|
12
|
+
```ruby
|
13
13
|
module NuWav
|
14
14
|
class FactChunk < NuWav::Chunk
|
15
15
|
attr_accessor :samples_number
|
@@ -30,7 +30,7 @@ module NuWav
|
|
30
30
|
end
|
31
31
|
```
|
32
32
|
|
33
|
-
|
33
|
+
## Note on Patches/Pull Requests
|
34
34
|
|
35
35
|
* Fork the project.
|
36
36
|
* Make your feature addition or bug fix.
|
@@ -40,6 +40,6 @@ end
|
|
40
40
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
41
41
|
* Send me a pull request. Bonus points for topic branches.
|
42
42
|
|
43
|
-
|
43
|
+
## Copyright
|
44
44
|
|
45
45
|
Copyright (c) 2010 Andrew Kuklewicz kookster. See LICENSE for details.
|
data/lib/nu_wav/version.rb
CHANGED
data/lib/nu_wav/wave_file.rb
CHANGED
@@ -28,7 +28,7 @@ module NuWav
|
|
28
28
|
NuWav::WaveFile.log "riff_length: #{riff_length}"
|
29
29
|
NuWav::WaveFile.log "wave_file_size: #{wave_file_size}"
|
30
30
|
|
31
|
-
raise NotRIFFFormat unless riff == 'RIFF'
|
31
|
+
raise NotRIFFFormat unless riff == 'RIFF' || riff == 'RF64'
|
32
32
|
riff_end = [f.tell + riff_length, wave_file_size].min
|
33
33
|
|
34
34
|
riff_type = f.read(4)
|
data/nu_wav.gemspec
CHANGED
Binary file
|
data/test/test_nu_wav.rb
CHANGED
@@ -89,6 +89,44 @@ class TestNuWav < Test::Unit::TestCase
|
|
89
89
|
memory_usage = `ps -o rss= -p #{Process.pid}`.to_i # in kilobytes
|
90
90
|
# puts "end of test: #{memory_usage/1024} mb"
|
91
91
|
end
|
92
|
+
|
93
|
+
def test_parse_mbwf
|
94
|
+
w = WaveFile.parse(File.expand_path(File.dirname(__FILE__) + '/files/bext_rf64.wav'))
|
95
|
+
|
96
|
+
assert_equal 6, w.chunks.size
|
97
|
+
|
98
|
+
# duration is calculated differently for mpeg and pcm
|
99
|
+
assert_equal 7456, w.duration
|
100
|
+
|
101
|
+
# fmt
|
102
|
+
assert_equal 2, w.chunks[:fmt].number_of_channels
|
103
|
+
assert_equal 96000, w.chunks[:fmt].sample_rate
|
104
|
+
assert_equal 576000, w.chunks[:fmt].byte_rate
|
105
|
+
assert_equal 6, w.chunks[:fmt].block_align
|
106
|
+
assert_equal 24, w.chunks[:fmt].sample_bits
|
107
|
+
assert_equal 0, w.chunks[:fmt].extra_size
|
108
|
+
assert_equal nil, w.chunks[:fmt].head_layer
|
109
|
+
assert_equal nil, w.chunks[:fmt].head_bit_rate
|
110
|
+
assert_equal nil, w.chunks[:fmt].head_mode
|
111
|
+
assert_equal nil, w.chunks[:fmt].head_mode_ext
|
112
|
+
assert_equal nil, w.chunks[:fmt].head_emphasis
|
113
|
+
assert_equal nil, w.chunks[:fmt].head_flags
|
114
|
+
|
115
|
+
# fact
|
116
|
+
assert_equal nil, w.chunks[:fact]
|
117
|
+
|
118
|
+
# mext
|
119
|
+
assert_equal nil, w.chunks[:mext]
|
120
|
+
|
121
|
+
# bext
|
122
|
+
assert_equal "", unpad(w.chunks[:bext].coding_history)
|
123
|
+
|
124
|
+
# cart
|
125
|
+
assert_equal nil, w.chunks[:cart]
|
126
|
+
|
127
|
+
# data
|
128
|
+
assert_equal 4294967295, w.chunks[:data].size
|
129
|
+
end
|
92
130
|
|
93
131
|
def test_from_mpeg
|
94
132
|
w = WaveFile.from_mpeg(File.expand_path(File.dirname(__FILE__) + '/files/test.mp2'))
|
metadata
CHANGED
@@ -1,55 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nu_wav
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kuklewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-mp3info
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.6.13
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.6.13
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '0'
|
55
69
|
description: NuWav is a pure ruby audio WAV file parser and writer. It supports Broadcast
|
@@ -61,16 +75,17 @@ executables: []
|
|
61
75
|
extensions: []
|
62
76
|
extra_rdoc_files: []
|
63
77
|
files:
|
64
|
-
- .gitignore
|
78
|
+
- ".gitignore"
|
65
79
|
- Gemfile
|
66
80
|
- LICENSE
|
67
|
-
- README.
|
81
|
+
- README.md
|
68
82
|
- Rakefile
|
69
83
|
- lib/nu_wav.rb
|
70
84
|
- lib/nu_wav/chunk.rb
|
71
85
|
- lib/nu_wav/version.rb
|
72
86
|
- lib/nu_wav/wave_file.rb
|
73
87
|
- nu_wav.gemspec
|
88
|
+
- test/files/bext_rf64.wav
|
74
89
|
- test/files/test.mp2
|
75
90
|
- test/files/test_basic.wav
|
76
91
|
- test/files/test_bwf.wav
|
@@ -87,21 +102,22 @@ require_paths:
|
|
87
102
|
- lib
|
88
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
104
|
requirements:
|
90
|
-
- -
|
105
|
+
- - ">="
|
91
106
|
- !ruby/object:Gem::Version
|
92
107
|
version: '0'
|
93
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
109
|
requirements:
|
95
|
-
- -
|
110
|
+
- - ">="
|
96
111
|
- !ruby/object:Gem::Version
|
97
112
|
version: '0'
|
98
113
|
requirements: []
|
99
114
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.6.4
|
101
116
|
signing_key:
|
102
117
|
specification_version: 4
|
103
118
|
summary: NuWav is a pure ruby audio WAV file parser and writer.
|
104
119
|
test_files:
|
120
|
+
- test/files/bext_rf64.wav
|
105
121
|
- test/files/test.mp2
|
106
122
|
- test/files/test_basic.wav
|
107
123
|
- test/files/test_bwf.wav
|