Created
May 1, 2017 23:59
-
-
Save chrisjmendez/86130966b83744cd080e2267cb97f22a to your computer and use it in GitHub Desktop.
Converting a WAV file to FLAC with customization. https://superuser.com/a/1145254
This file contains 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
namespace :convert do | |
# https://superuser.com/a/1145254 | |
desc %Q{ ›› Convert from WAC to FLAC to 16-bit and 44.1 kHz. } | |
task :low_res, [:wav, :flac] do |task, args| | |
wav = args.wav | |
flac = args.flac | |
bit_rate = 16 | |
sample_rate = 44100 | |
sh %{ ffmpeg -i #{wav} -af aformat=s#{bit_rate}:#{sample_rate} #{flac} } | |
end | |
desc %Q{ ›› Convert from WAC to FLAC to 32-bit and 176,000 kHz. } | |
task :high_res, [:wav, :flac] do |task, args| | |
wav = args.wav | |
flac = args.flac | |
bit_rate = 32 | |
sample_rate = 176000 | |
sh %{ ffmpeg -i #{wav} -af aformat=s#{bit_rate}:#{sample_rate} #{flac} } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment