carrierwave-audio 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49be079517a1eb28406b25ccca4a0060bd179c6e
4
- data.tar.gz: 2700deff88842e204e30d388c4a31024259f39c7
3
+ metadata.gz: 8c9b7615a28c346d73cd16017f9943d4477b560d
4
+ data.tar.gz: ddd8e120252b8c032727e568f3d6fcaf6bbd4c9a
5
5
  SHA512:
6
- metadata.gz: e515174ee12fe72e4a2964fb9d91d7276ef86ddb6ee00bbb19f85bc31b3f95105f3ebc9fefa8951f677644d4f40177308db7b646184cac8d5bbb54c4ac944841
7
- data.tar.gz: 25510a82ccf5ee7fc64cad64ab1127f4d8cf7b2345881bec62dee7b871a93e254d5ad235c3eeb83e1d035650546a4c60afb8b22b27a288eac34d904aa3f2cb13
6
+ metadata.gz: 7b5d82802d447ece58bd1260ed2bc538b130d19882132886975649dfb0d5d069f4b9a3db9ee77d8367141947935584908d6597bdc32567403d998c20502f6e22
7
+ data.tar.gz: 74ff970538d3d380daf2fba2244e66002bfd10d1639636b86b49889d552c3dedd0f9825795ad642b68c047215eb2ce3e9a82e24ac94d2d0d6432d5c2585b7f29
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  Include CarrierWave::Audio into your CarrierWave uploader class:
22
22
 
23
23
  ```ruby
24
- class VideoUploader < CarrierWave::Uploader::Base
24
+ class AudioUploader < CarrierWave::Uploader::Base
25
25
  include CarrierWave::Audio
26
26
  end
27
27
  ```
@@ -81,7 +81,9 @@ If you'd like to add a watermark over the top of your file, use `watermark` like
81
81
  process :watermark => [watermark_file_path, output_format, output_options]
82
82
  ```
83
83
 
84
- `watermark_file_path` - REQUIRED. Path to where your watermarked file is stored
84
+ `watermark_file_path` - REQUIRED. Path to where your watermarked file is stored.
85
+
86
+ VERY IMPORTANT: The watermarked file must be a 44.1k, 2-channel mp3. It needs to be a long file. It'll be concatenated to fit the length of your uploaded file.
85
87
 
86
88
  `output_format` - Optional. The only currently available option is the default, `:mp3`.
87
89
 
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Audio
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -37,16 +37,16 @@ module CarrierWave
37
37
 
38
38
  # Normalize file to -6dB
39
39
  normalized_tmp_path = File.join File.dirname(current_path), "tmp_norm_#{current_filename_without_extension}_#{Time.current.to_i}.#{input_options[:type]}"
40
- convert_file(current_path, input_options, normalized_tmp_path, input_options, { gain: "-n -6" })
40
+ convert_file(current_path, input_options, normalized_tmp_path, default_output_options(input_options[:type]), { gain: "-n -6" })
41
41
 
42
42
  # Combine normalized file and watermark, normalizing final product to 0dB
43
43
  final_tmp_path = File.join File.dirname(current_path), "tmp_wtmk_#{current_filename_without_extension}_#{Time.current.to_i}.#{format}"
44
- converter = Sox::Cmd.new(combine: :mix)
45
- converter.add_input normalized_tmp_path, input_options
46
- converter.add_input watermark_file_path, watermark_options
47
- converter.set_output final_tmp_path, default_output_options(format).merge(output_options)
48
- converter.set_effects({ trim: "0 #{Soxi::Wrapper.file(current_path).seconds}", gain: "-n" })
49
- converter.run
44
+ combiner = Sox::Cmd.new(combine: :mix)
45
+ combiner.add_input normalized_tmp_path, input_options
46
+ combiner.add_input watermark_file_path, watermark_options
47
+ combiner.set_output final_tmp_path, default_output_options(format).merge(output_options)
48
+ combiner.set_effects({ trim: "0 #{Soxi::Wrapper.file(current_path).seconds}", gain: "-n" })
49
+ combiner.run
50
50
  File.rename final_tmp_path, current_path
51
51
  set_content_type format
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-audio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Hinesley