0

I have an audio file with '.opus' format. http://img.wbcsrv.com/2017/03/14/4915792368684-41222-919020044692-1489468385000.opus I need to use it with google cloud speech API. But the google speech API only support some file encodings, specified in https://cloud.google.com/speech/docs/basics#audio-encodings . How can i use 'opus' file format with google cloud speech API? Is there any way to convert '.opus' file into the specified(googles audio encoding documentation) format or any npm available for do this?

joe
  • 365
  • 1
  • 5
  • 16
  • Do you need to do the conversion in Node? Or is it OK to change the file format with a totally different tool? – blambert Apr 01 '17 at 06:56

1 Answers1

0

In Node you can use ffmpgeg in several ways, using:

The ffmpeg supports Opus according to the docs:

You may need to use libopus for that:

The ffmpeg also supports encoding FLAC so it can also be used for that part:

There is not a straightforward way to convert Opus to Flac using Node without any external dependencies but it should be possible using the modules and libraries above.

rsp
  • 107,747
  • 29
  • 201
  • 177
  • This npm's are all converting from a video file. Actualy '.opus' file is an audio file. In https://www.npmjs.com/package/ffmpeg npm it converts from a video with extension '.avi' to mp3. I want to convert 'opus' file to an extension (audio encoding), that support google speech api. – joe Mar 29 '17 at 12:03