如何从基于 Javascript 的 web 应用程序录制音频? [英] How does one record audio from a Javascript based webapp?

查看:21
本文介绍了如何从基于 Javascript 的 web 应用程序录制音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个记录 WAV 文件的网络应用程序(例如:来自用户的麦克风).我知道单靠 Javascript 无法做到这一点,但我对用最少的专有方法来增强我的 Javascript 感兴趣.我的目标浏览器是适用于 PC 和 Mac 的 Firefox(因此没有 ActiveX).

I'm trying to write a web-app that records WAV files (eg: from the user's microphone). I know Javascript alone can not do this, but I'm interested in the least proprietary method to augment my Javascript with. My targeted browsers are Firefox for PC and Mac (so no ActiveX).

我认为它可以用 Flash 完成(但不能作为 WAV 格式的文件).我认为它可以用 Java 完成(但不能没有代码签名).这些是唯一的选择吗?

I gather it can be done with Flash (but not as a WAV formated file). I gather it can be done with Java (but not without code-signing). Are these the only options?

我想将该文件录制为 WAV,因为 Web 应用程序的目的是组装一个优质 质量的短片库.我估计上传将是 50 MB,这对于质量来说是非常值得的.该应用程序将仅用于我们的内联网.

I'd like to record the file as a WAV because because the purpose of the webapp will be to assemble a library of good quality short soundbites. I estimate upload will be 50 MB, which is well worth it for the quality. The app will only be used on our intranet.

更新:由于 JetPack 即将推出的音频 API,现在有一个替代解决方案:请参阅 https://wiki.mozilla.org/Labs/Jetpack/JEP/18

UPDATE: There's now an alternate solution thanks to JetPack's upcoming Audio API: See https://wiki.mozilla.org/Labs/Jetpack/JEP/18

推荐答案

Flash 要求您使用媒体服务器(注意:我仍在使用 Flash MX,但在 Google 上快速搜索会显示 Flash CS3 的文档,似乎同意 - 请注意 Flash CS4 即将推出,届时可能会更改).Macromedia/Adob​​e 旨在为您提供他们的媒体服务器,但 Red5 开源项目可能适合您的项目:

Flash requires you to use a media server (note: I'm still using Flash MX, but a quick Google search brings up documentation for Flash CS3 that seems to concur - note that Flash CS4 is out soon, might change then). Macromedia / Adobe aim to flog you their media server, but the Red5 open-source project might be suitible for your project:

http://osflash.org/red5

我认为 Java 会更合适.我在 Moodle(一个开源虚拟学习环境)上看到过一个可以做你想做的事情的小程序:

I think Java is going to be more suitible. I've seen an applet that might do what you want over on Moodle (an open-source virtual learning environment):

http://64.233.183.104/search?q=cache:k27rcY8QNWoJ:moodle.org/mod/forum/discuss.php%3Fd%3D51231+moodlespeex&hl=en&ct=clnk&cd=1&gl=uk

(需要会员资格的网站,但对 Google 开放,因此链接转到 Google 缓存页面).

(membership-required site, but open to Google, hence the link goes to the Google cache page).

这篇关于如何从基于 Javascript 的 web 应用程序录制音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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