json-waveform 0.1.0 → 0.2.0
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/bin/json-waveform +3 -7
- data/lib/json-waveform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d36b9399da8bc246ec51e20d9ce4f89763cc5443
|
4
|
+
data.tar.gz: e2c18ef64ce38d2c7121b4db7d2e75d737e3c4ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83b0f46eaf8f4140f2dd2f0917fbeea85739c38b87842f96229ed6a7d7c1f13d57d33f1d0b563991430c57482c8941e2a3556c34aee2f345dfff91aac999476
|
7
|
+
data.tar.gz: 96fc580e294ad1c31ebce0f0fd14212f94617e77244aabed5d72d3b1d54ec64797430262cbbde7c97be549fcddd54968056e7ffe7d0904c5e60eedde63ed68e2
|
data/bin/json-waveform
CHANGED
@@ -5,13 +5,9 @@ require "optparse"
|
|
5
5
|
|
6
6
|
options = JsonWaveform::DEFAULT_OPTIONS
|
7
7
|
optparse = OptionParser.new do |o|
|
8
|
-
o.banner = "Usage: json-waveform [options] source_audio"
|
8
|
+
o.banner = "Usage: json-waveform [options] source_audio [output]"
|
9
9
|
o.version = JsonWaveform::VERSION
|
10
10
|
|
11
|
-
o.on("-o", "--output FILE", "File where to write the JSON -- Default is stdout.") do |output|
|
12
|
-
options[:output] = output
|
13
|
-
end
|
14
|
-
|
15
11
|
o.on("-s", "--samples SAMPLES", "Samples generated from the original file (i.e.: waveform width) -- Default #{JsonWaveform::DEFAULT_OPTIONS[:samples]}.") do |samples|
|
16
12
|
options[:samples] = samples.to_i
|
17
13
|
end
|
@@ -38,8 +34,8 @@ optparse.parse!
|
|
38
34
|
|
39
35
|
begin
|
40
36
|
result = JSON.dump(JsonWaveform.generate(ARGV[0], options))
|
41
|
-
if
|
42
|
-
File.open(
|
37
|
+
if ARGV[1]
|
38
|
+
File.open(ARGV[1], 'w') do |file|
|
43
39
|
file.write result
|
44
40
|
end
|
45
41
|
else
|