如何从JavaScript使用Opus编解码器 [英] How can I use Opus Codec from JavaScript

查看:101
本文介绍了如何从JavaScript使用Opus编解码器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看是否有可能使用 getUserMedia 或最新浏览器中的类似内容直接访问Opus.

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 on it a lot but with no Good results.

我知道 webkitSpeechRecognition API中实际上使用了Opus或Speex.我想做语音识别,但是要使用我自己的服务器而不是Google的服务器.

I'm aware that either Opus or Speex are actually used in webkitSpeechRecognition API. I would like to do speech recognition but using my own server rather than Google's.

推荐答案

因此,关于Emscripten的建议很多,但没有人建议,所以我移植了编码器

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()

这篇关于如何从JavaScript使用Opus编解码器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆