typecast-ruby 0.1.10 → 0.1.11
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/lib/typecast/models.rb +15 -5
- data/lib/typecast/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eca399615eb6a742c1a08ee80bf61ad3c03a30a2225b895275da6bac9f6398ea
|
|
4
|
+
data.tar.gz: 62fce2fe688c24b6e9b0860123db60e624a35aacc01ac6763a20ba507325e822
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c19aa000d956bc9022cb4099ecc9d7d11c9b70a3197c95eccc46f38aadf0817c31d2425175b933c1c8b169c1c797e014e9216829a2d0c32e11d718e70351526
|
|
7
|
+
data.tar.gz: 5760fc399813e6241439aa5b48c272b9210d5e19d388a48d323d04f282f4cdbfb537b7d7e2ad12381d99c38e3034f75a1bd56f027f6abc0f4cd496fb7208f64d
|
data/lib/typecast/models.rb
CHANGED
|
@@ -13,9 +13,13 @@ module Typecast
|
|
|
13
13
|
].freeze
|
|
14
14
|
|
|
15
15
|
class Output
|
|
16
|
-
attr_reader :volume, :target_lufs, :audio_pitch, :audio_tempo, :audio_format
|
|
16
|
+
attr_reader :volume, :target_lufs, :audio_pitch, :audio_tempo, :audio_format, :remove_silence_ms
|
|
17
17
|
|
|
18
|
-
def initialize(volume: nil, target_lufs: nil, audio_pitch: nil, audio_tempo: nil, audio_format: nil)
|
|
18
|
+
def initialize(volume: nil, target_lufs: nil, audio_pitch: nil, audio_tempo: nil, audio_format: nil, remove_silence_ms: nil)
|
|
19
|
+
unless remove_silence_ms.nil? || (remove_silence_ms.is_a?(Integer) && (0..1000).cover?(remove_silence_ms))
|
|
20
|
+
raise ArgumentError, "remove_silence_ms must be an integer between 0 and 1000"
|
|
21
|
+
end
|
|
22
|
+
@remove_silence_ms = remove_silence_ms
|
|
19
23
|
@volume = volume
|
|
20
24
|
@target_lufs = target_lufs
|
|
21
25
|
@audio_pitch = audio_pitch
|
|
@@ -26,6 +30,7 @@ module Typecast
|
|
|
26
30
|
def to_h
|
|
27
31
|
Models.compact(
|
|
28
32
|
volume: volume,
|
|
33
|
+
remove_silence_ms: remove_silence_ms,
|
|
29
34
|
target_lufs: target_lufs,
|
|
30
35
|
audio_pitch: audio_pitch,
|
|
31
36
|
audio_tempo: audio_tempo,
|
|
@@ -35,9 +40,13 @@ module Typecast
|
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
class OutputStream
|
|
38
|
-
attr_reader :audio_pitch, :audio_tempo, :audio_format, :target_lufs
|
|
43
|
+
attr_reader :audio_pitch, :audio_tempo, :audio_format, :target_lufs, :remove_silence_ms
|
|
39
44
|
|
|
40
|
-
def initialize(audio_pitch: nil, audio_tempo: nil, audio_format: nil, target_lufs: nil)
|
|
45
|
+
def initialize(audio_pitch: nil, audio_tempo: nil, audio_format: nil, target_lufs: nil, remove_silence_ms: nil)
|
|
46
|
+
unless remove_silence_ms.nil? || (remove_silence_ms.is_a?(Integer) && (0..1000).cover?(remove_silence_ms))
|
|
47
|
+
raise ArgumentError, "remove_silence_ms must be an integer between 0 and 1000"
|
|
48
|
+
end
|
|
49
|
+
@remove_silence_ms = remove_silence_ms
|
|
41
50
|
@audio_pitch = audio_pitch
|
|
42
51
|
@audio_tempo = audio_tempo
|
|
43
52
|
@audio_format = audio_format
|
|
@@ -49,7 +58,8 @@ module Typecast
|
|
|
49
58
|
audio_pitch: audio_pitch,
|
|
50
59
|
audio_tempo: audio_tempo,
|
|
51
60
|
audio_format: audio_format,
|
|
52
|
-
target_lufs: target_lufs
|
|
61
|
+
target_lufs: target_lufs,
|
|
62
|
+
remove_silence_ms: remove_silence_ms
|
|
53
63
|
)
|
|
54
64
|
end
|
|
55
65
|
end
|
data/lib/typecast/version.rb
CHANGED