json-waveform 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/json-waveform +8 -8
- data/json-waveform.gemspec +1 -1
- data/lib/json-waveform/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae6fa8b7dd587bc93aabb07369419ac3970c2163
|
4
|
+
data.tar.gz: 3e758570a3a7f1fdf82d0709d1bdc4052db233e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d8e7ba690cd2d0de0cf0302b198b9435a709db9aacb63dba4d5fd92f85e0f6d4e08ed32d869f3d57c8e7caa535cc01d18c231777dcee2f922562b72b344d1d4
|
7
|
+
data.tar.gz: 2215729a95823336761941d162967a961e244a5a5cb983f1ce057af2e42adaee863e6b9e0dca3518d81de9fc895e7e7b14f9a726e87084210e3e30becbac5346
|
data/bin/json-waveform
CHANGED
@@ -4,14 +4,14 @@ require "optparse"
|
|
4
4
|
|
5
5
|
options = JsonWaveform::DEFAULT_OPTIONS
|
6
6
|
optparse = OptionParser.new do |o|
|
7
|
-
o.banner = "Usage: waveform [options] source_audio"
|
8
|
-
o.version =
|
7
|
+
o.banner = "Usage: json-waveform [options] source_audio"
|
8
|
+
o.version = JsonWaveform::VERSION
|
9
9
|
|
10
|
-
o.on("-s", "--samples SAMPLES", "Samples generated from the original file (i.e.: waveform width) -- Default #{
|
10
|
+
o.on("-s", "--samples SAMPLES", "Samples generated from the original file (i.e.: waveform width) -- Default #{JsonWaveform::DefaultOptions[:samples]}.") do |samples|
|
11
11
|
options[:samples] = samples.to_i
|
12
12
|
end
|
13
13
|
|
14
|
-
o.on("-A", "--amplitude AMPLITUDE", "Max amplitude of the waveform values-- Default #{
|
14
|
+
o.on("-A", "--amplitude AMPLITUDE", "Max amplitude of the waveform values-- Default #{JsonWaveform::DefaultOptions[:amplitude]}.") do |amplitude|
|
15
15
|
options[:amplitude] = amplitude.to_i
|
16
16
|
end
|
17
17
|
|
@@ -19,7 +19,7 @@ optparse = OptionParser.new do |o|
|
|
19
19
|
options[:auto_sample] = msec.to_i
|
20
20
|
end
|
21
21
|
|
22
|
-
o.on("-m", "--method METHOD", "Wave analyzation method (can be 'peak' or 'rms') -- Default '#{
|
22
|
+
o.on("-m", "--method METHOD", "Wave analyzation method (can be 'peak' or 'rms') -- Default '#{JsonWaveform::DefaultOptions[:method]}'.") do |method|
|
23
23
|
options[:method] = method.to_sym
|
24
24
|
end
|
25
25
|
|
@@ -32,12 +32,12 @@ end
|
|
32
32
|
optparse.parse!
|
33
33
|
|
34
34
|
begin
|
35
|
-
result =
|
35
|
+
result = JsonWaveform.generate(ARGV[0], options)
|
36
36
|
puts result
|
37
|
-
rescue
|
37
|
+
rescue JsonWaveform::ArgumentError => e
|
38
38
|
puts e.message + "\n\n"
|
39
39
|
puts optparse
|
40
|
-
rescue
|
40
|
+
rescue JsonWaveform::RuntimeError => e
|
41
41
|
puts e.message
|
42
42
|
end
|
43
43
|
|
data/json-waveform.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = JsonWaveform::VERSION
|
6
6
|
s.summary = "Generate waveform JSON files from audio files"
|
7
7
|
s.description = "Generate waveform JSON information from audio files, compatible with http://waveformjs.org/."
|
8
|
-
s.authors = ["Esteban
|
8
|
+
s.authors = ["Esteban Pastorino"]
|
9
9
|
s.email = ["ejpastorino@gmail.com"]
|
10
10
|
s.homepage = "http://github.com/kitop/json-waveform"
|
11
11
|
|
metadata
CHANGED