Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SoX doesn't work with Opus Audio files

I am recording input microphone from a web page with WebRTC and process it through SoX.

Problem is, Firefox recordings are in Opus Audio format (according to VLC media informations), in an Ogg container, and SoX doesn't like it : /opt/local/bin/sox FAIL formats: can't open input file `/Users/[...]/public/audio/7a0d13a501.ogg': Input not an Ogg Vorbis audio stream

Is there a way to make it work with SoX? Or should I use another command-line audio tool?

like image 343
ryancey Avatar asked Mar 11 '14 10:03

ryancey


1 Answers

I ended up doing this (either works, don't know which is the fastest):

opusdec --force-wav file.ogg - | sox - file.mp3

or

sox "|opusdec --force-wav file.ogg -" file.mp3

like image 140
ryancey Avatar answered Nov 02 '22 15:11

ryancey