ryancey
ryancey

Reputation: 1057

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?

Upvotes: 10

Views: 13840

Answers (3)

rolyan trauts
rolyan trauts

Reputation: 9

sox -t opus file.ogg out.wav works fine and not sure why opus is not part of the build on debian.

https://github.com/chirlu/sox/blob/master/INSTALL

Don't trust the distro build yourself as sox rox :)

Upvotes: 0

Contemplator
Contemplator

Reputation: 1

You can just specify -t opus when running sox

    sox -t opus file.ogg out.wav

Upvotes: 0

ryancey
ryancey

Reputation: 1057

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

Upvotes: 16

Related Questions