Last active
September 26, 2019 12:33
-
-
Save dtinth/c4c7e6ec24a89df43065f26b741f26e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_list = Dir['original/*.wav'] | |
file_list.each_with_index do |original_wav, index| | |
basename = File.basename(original_wav) | |
target_wav = "processed/#{basename}" | |
gain = case basename | |
when /^piano/; 4 | |
else; 0 | |
end | |
puts "[#{index + 1}/#{file_list.length}] #{basename} (#{gain})" | |
system "sox", original_wav, target_wav, "gain", "#{gain}" or raise "Cannot convert" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment