Revision: 5f7c54e28566
Author: Bouke Woudstra <
boukew...@gmail.com>
Date: Wed Jan 9 12:29:39 2013
Log: Fix for issue 484 (use normalize-audio if normalize is not found)
http://code.google.com/p/rubyripper/source/detail?r=5f7c54e28566
Modified:
/lib/rubyripper/encode.rb
=======================================
--- /lib/rubyripper/encode.rb Tue Jan 8 10:18:05 2013
+++ /lib/rubyripper/encode.rb Wed Jan 9 12:29:39 2013
@@ -96,14 +96,17 @@
def waitingForNormalizeToFinish(track=nil)
return false if @prefs.normalizer != 'normalize'
+ binary = getNormalizeBinary()
+ return false unless binary.class == String
+
if @prefs.gain == 'track' || @prefs.image
- command = "normalize \"#{@scheme.getTempFile(track, 1)}\""
+ command = "#{binary} \"#{@scheme.getTempFile(track, 1)}\""
@exec.launch(command)
waiting = false
elsif @prefs.gain == 'album' && @trackSelection[-1] != track
waiting = true
elsif @prefs.gain == 'album' && @trackSelection[-1] == track
- command = "normalize -b
\"#{File.join(@scheme.getTempDir(),'*.wav')}\""
+ command = "#{binary} -b
\"#{File.join(@scheme.getTempDir(),'*.wav')}\""
@exec.launch(command)
# now the wavs are altered, the encoding can start
@trackSelection.each{|track| startEncoding(track)}
@@ -112,6 +115,18 @@
return waiting
end
+ # the binary can differ between distributions
+ def getNormalizeBinary
+ if @deps.installed?('normalize')
+ return 'normalize'
+ elsif @deps.installed?('normalize-audio')
+ return 'normalize-audio'
+ else
+ puts "DEBUG: No normalize binary found, normalizing is skipped.." if
@prefs.debug
+ return false
+ end
+ end
+
# call the specific codec function for the track and apply replaygain if
desired
def encodeTrack(codec, track=nil)
@log.encodingErrors = true if @exec.launch(codec.command(track)).empty?