Using guard and lame to convert wav to mp3.
Using guard and lame to convert wav to mp3.
# Gemfile:
gem 'guard'
gem 'guard-shell'
# Guardfile:
guard :shell do
SOURCE = "/var/records/source"
DESTINATION = "/var/records/dest"
watch %r{^(.*)\.wav$} do |m|
"lame -b 32 --resample 8 -a #{SOURCE}/#{m[1]}.wav #{DESTINATION}/#{m[1]}.mp3"
end
ignore %r{^in-(.*)\.wav$}, %r{^out-(.*)\.wav$}
end
Shell command:
bundle exec guard --watchdir #{GUARD_WATCH_DIR} --guardfile #{GUARD_CONFIG_FILE}
Upytime 2 months.
Written by Alexander Chaychuk
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#