ruby on rails - Convert mp3 to flac files -


i'm trying find way of converting mp3 flac files using ruby (preferably) server-side. have horde of audio transcribe using google speech api accepts flac. (among other things). can find flac2mp3 convertor work on laptop, went through code , unfortunately seems calling system command requires having codecs installed locally. .

is there api maybe me? or easy way install codecs , run sort of command on heroku.

@orde linked exiting question recommends following:

ffmpeg -i input.mp3 output.flac 

this not ruby command, system command (i.e. unix or windows)

to call system command ruby, can use backticks or system.

for example, after you've installed ffmpeg system

def convert_mp3_to_flac(mp3_path)   flac_path = mp3_path.gsub(".mp3", ".flac")   system("ffmpeg -i #{mp3_path} #{flac_path}") end  

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -