How can I use Opus Codec from JavaScript

后端 未结 4 483
耶瑟儿~
耶瑟儿~ 2021-02-05 15:31

I would like to see if it\'s possible to have direct access to Opus using getUserMedia or anything similar from the latest browsers.

I\'ve been researching

4条回答
  •  渐次进展
    2021-02-05 15:52

    So there are a lot of suggestions about Emscripten but nobody did, so I ported the encoder opus-tools to JavaScript using Emscripten. Dependent on what one has in mind, there are now the following opportunities:

    • Encoding FLAC, WAVE, AIFF, RAW files || demo || Web Worker size: 1.3 MiB
    • Encoding raw stuff for immediately processing or sending without container || demo || Web Worker size: 0.6 MiB
    • Encoding to Ogg-Opus and WAV from getUserMedia stream
    • When using Mozilla Firefox, it's possible to use a MediaRecorder, which would also allow to convert arbitrary sound files into Opus format on supported platforms together with AudioContext.decodeAudioData()

提交回复
热议问题