简体   繁体   English

在浏览器压缩音频的解决方案?

[英]solutions to compress audio in browser?

I am working on getting audio recorded directly in browser and POSTed to a webserver. 我正在努力将音频直接录制到浏览器中并发布到网络服务器。 I am currently relying on flash to access the user microphone (using code derived from https://code.google.com/p/wami-recorder/ ) and passing the recorded Wav/pcm blob from flash to JS for upload (using XHR post). 我目前依靠flash来访问用户麦克风(使用源自https://code.google.com/p/wami-recorder/的代码)并将录制的Wav / pcm blob从flash传递给JS进行上传(使用XHR后)。 This works fine, but I am trying to avoid sending uncompressed WAV data (I can compress the audio on the server, but I am trying to limit CPU intensive work there). 这工作正常,但我试图避免发送未压缩的WAV数据(我可以压缩服务器上的音频,但我试图限制CPU密集型工作)。

Options I have found so far to compress to ogg on client side include: 到目前为止,我发现在客户端压缩到ogg的选项包括:

  • relying on lab features of flash to compress the audio to ogg (labs.byhook.com/2011/02/15/ogg-vorbis-encoder-for-flash-alchemy-series-part-1/). 依靠闪光灯的实验室功能将音频压缩到ogg(labs.byhook.com/2011/02/15/ogg-vorbis-encoder-for-flash-alchemy-series-part-1/)。 Since it is an experimental feature in flash, it's risky to rely on it. 由于它是闪存中的实验性功能,因此依赖它是有风险的。

  • porting a minimal subset of libvorbis to javascript so that the browser can compress the data. 将libvorbis的最小子集移植到javascript,以便浏览器可以压缩数据。 This probably sounds a bit silly, but I only need short audio bits (a few seconds) so performance may not be such an issue. 这可能听起来有点傻,但我只需要短音频位(几秒钟),因此性能可能不是这样的问题。 I have looked around, but couldn't find any such project going on. 我环顾四周,但找不到任何这样的项目。

  • a few other browser specific solutions such as http://firefogg.org which require substantial user-side install to work, which I don't want. 一些其他浏览器特定的解决方案,如http://firefogg.org ,需要大量的用户端安装才能工作,这是我不想要的。

I'm looking for a better option to solve this issue, if such an option exists. 如果存在这样的选项,我正在寻找更好的选择来解决这个问题。 I am obviously waiting for html5 getUserMedia() to work, but I need a solution in the meantime that works cross-browser (not necessarily 100%, but at least on major/recent browsers). 我显然在等待html5 getUserMedia()工作,但我需要一个解决方案同时适用于跨浏览器(不一定是100%,但至少在主要/最近的浏览器上)。

Flash: https://github.com/maxl0rd/standingwave3 eg: www.jordansthings.com/blog/?p=5 support mp3. Flash: https ://github.com/maxl0rd/standingwave3例如:www.jordansthings.com/blog/?p = 5支持mp3。

js compression: https://github.com/jpemartins/speex.js no good examples. js压缩: https//github.com/jpemartins/speex.js没有很好的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM