audio_monster 1.1.1 → 1.1.2
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/audio_monster/monster.rb +2 -2
- data/lib/audio_monster/version.rb +1 -1
- data/test/monster_test.rb +6 -0
- 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: 3a057b2a1f3a759502c32a054151db67b29c7f94
|
4
|
+
data.tar.gz: 8dc01f649e809dedc68c1530bc58a591071cf32b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228c4f3616a61b1e9bb0fa49baf2e8ae4dbac65f2c13916d4b121f196f1ae5272c3382f5f65944e7dfd09014ce6fdfd3eacf2aa958bda5dd74335696ac557fe3
|
7
|
+
data.tar.gz: f433d041ae8ea1d4ba0c964ebd6bb879e8ea48b77b436c104b0ed93995b2c53f7e1ef274fc772a2c1eee14ad302d591c5f756969bc0d1e0b9fa6fdba44820783
|
@@ -619,8 +619,8 @@ module AudioMonster
|
|
619
619
|
wav_info = info_for_wav(wav_path)
|
620
620
|
logger.debug "cut_wav: wav_info:#{wav_info.inspect}"
|
621
621
|
|
622
|
-
new_length = [wav_info[:length].
|
623
|
-
fade_length = [wav_info[:length].
|
622
|
+
new_length = [wav_info[:length].to_f, length.to_f].min
|
623
|
+
fade_length = [wav_info[:length].to_f, fade.to_f].min
|
624
624
|
|
625
625
|
# find out if the wav file is stereo or mono as this needs to match the starting wav
|
626
626
|
channels = wav_info[:channel_mode] == 'Mono' ? 1 : 2
|
data/test/monster_test.rb
CHANGED
@@ -117,6 +117,12 @@ describe AudioMonster::Monster do
|
|
117
117
|
slice_wav.duration.must_equal 5
|
118
118
|
end
|
119
119
|
|
120
|
+
it 'can cut a section from the top of an audio file' do
|
121
|
+
monster.cut_wav(in_file('test_long.wav'), out_file('cut.wav'), '5', 1).wont_be_nil
|
122
|
+
cut_wav = NuWav::WaveFile.parse(out_file('cut.wav'))
|
123
|
+
cut_wav.duration.must_equal 5
|
124
|
+
end
|
125
|
+
|
120
126
|
it 'can create a temp file with a really long name' do
|
121
127
|
base_file_name = ('abc' * 100) + '.extension'
|
122
128
|
file = AudioMonster.create_temp_file(base_file_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audio_monster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kuklewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nu_wav
|