audio_hero 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: ef34f4875f7612753b03ea02a76a00d805321be6
4
- data.tar.gz: da6f18a75cf510220b496687da290cdb1554003e
3
+ metadata.gz: f6648188267d375754831846adec65a3e9dc353b
4
+ data.tar.gz: f7426c5fc60293aabafb8f1fd30f2a955ed1255f
5
5
  SHA512:
6
- metadata.gz: 54052b312fd2e532b6a8298dc9cce2a8b286717047c12ee48b28d37426167d088152e8b50c2dd81ae575d9b1b1c2ddcd33627de0f23c291304a248d1df181093
7
- data.tar.gz: 83253909044197527bdc4f5e924b0bf239f29c6189c350ec3de4e83059d9d01f99165681720745ea7a04a65e4122296aab29a863c279dfc2c2757b3504213925
6
+ metadata.gz: 453e8140a27247b787c419a71fa3489c877d81411af4ac6b73ffa9a998c942320d849ea16d0f4d552a6a2e154c6d7c54ef2c3c4461ba8015d84d66234f7bf52b
7
+ data.tar.gz: ad03392112ca8f646a27eb1f306aeb98272ffac141487014ae29a6eca9257d8b8bacbf882e11634c569edb007d7c9b09dbc5e8158acbcdad7d8bdd5c104df6c6
data/README.md CHANGED
@@ -60,8 +60,10 @@ Options(hash):
60
60
  file = AudioHero::Sox.new(file).remove_silence({input_format: "wav", gc: "true"})
61
61
  ```
62
62
  Options(hash):
63
- * silence_duration (default to 0.1 seconds)
64
- * silence_level (default to 0.03%)
63
+ * above_period_duration (default to 0.1 seconds)
64
+ * above_period_threshold silence_level (default to 0.03%)
65
+ * below_period_duration (default to 0.1 seconds)
66
+ * below_period_threshold silence_level (default to 0.03%)
65
67
  * input_format (default to "mp3")
66
68
  * output_format (default to "wav")
67
69
  * gc (no default, set to "true" to auto close! input file)
@@ -73,8 +75,10 @@ file_array = AudioHero::Sox.new(file).split_by_silence({input_format: "wav", gc:
73
75
  # file_array == ["path/to/out001.wav", "path/to/out002.wav"]
74
76
  ```
75
77
  Options(hash):
76
- * silence_duration (default to 0.1 seconds)
77
- * silence_level (default to 0.03%)
78
+ * above_period_duration (default to 0.5 seconds)
79
+ * above_period_threshold silence_level (default to 0.05%)
80
+ * below_period_duration (default to 1.0 seconds)
81
+ * below_period_threshold silence_level (default to 0.02%)
78
82
  * input_format (default to "mp3")
79
83
  * output_format (default to "wav")
80
84
  * output_filename (base filename, default to "out". If using custom version of SOX, use "%,1c" for starttime and use "%1,1c-%1,1d" for starttime-endtime as filename)
@@ -52,9 +52,11 @@ module AudioHero
52
52
 
53
53
  # Usage: file = AudioHero::Sox.new(file).remove_silence
54
54
  def remove_silence(options={})
55
- silence_duration = options[:silence_duration] || "0.1"
56
- silence_level = options[:silence_level] || "0.03"
57
- effect = "silence 1 #{silence_duration} #{silence_level}% -1 #{silence_duration} #{silence_level}%"
55
+ above_period_duration = options[:above_period_duration] || "0.1"
56
+ above_period_threshold = options[:above_period_threshold] || "0.03"
57
+ below_period_duration = options[:below_period_duration] || "0.1"
58
+ below_period_threshold = options[:below_period_threshold] || "0.03"
59
+ effect = "silence 1 #{above_period_duration} #{above_period_threshold}% -1 #{below_period_threshold} #{below_period_threshold}%"
58
60
  input_format = options[:input_format] ? options[:input_format] : "mp3"
59
61
  output_format = options[:output_format] ? options[:output_format] : "wav" # Default to wav
60
62
 
@@ -80,9 +82,12 @@ module AudioHero
80
82
  # FileUtils.remove_entry tempdir
81
83
 
82
84
  def split_by_silence(options={})
83
- silence_duration = options[:silence_duration] || "0.5"
84
- silence_level = options[:silence_level] || "0.03"
85
- effect = "silence 1 #{silence_duration} #{silence_level}% 1 #{silence_duration} #{silence_level}% : newfile : restart"
85
+ above_period_duration = options[:above_period_duration] || "0.5"
86
+ above_period_threshold = options[:above_period_threshold] || "0.05"
87
+ below_period_duration = options[:below_period_duration] || "1.0"
88
+ below_period_threshold = options[:below_period_threshold] || "0.02"
89
+
90
+ effect = "silence 1 #{above_period_duration} #{above_period_threshold}% 1 #{below_period_duration} #{below_period_threshold}% : newfile : restart"
86
91
  input_format = options[:input_format] ? options[:input_format] : "mp3"
87
92
  output_format = options[:output_format]
88
93
  output_filename = options[:output_filename] || "out"
@@ -1,3 +1,3 @@
1
1
  module AudioHero
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audio_hero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - litenup
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler