audiotype-conversionoggsoxopus

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?


Solution

  • 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