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 +4 -4
- data/README.md +8 -4
- data/lib/audio_hero.rb +11 -6
- data/lib/audio_hero/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: f6648188267d375754831846adec65a3e9dc353b
|
4
|
+
data.tar.gz: f7426c5fc60293aabafb8f1fd30f2a955ed1255f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
*
|
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
|
-
*
|
77
|
-
* silence_level (default to 0.
|
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)
|
data/lib/audio_hero.rb
CHANGED
@@ -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
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
84
|
-
|
85
|
-
|
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"
|
data/lib/audio_hero/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|