GWT 音频录制
在 GWT 应用程序中是否有用于录制音频的选项?
选项似乎包括flex,也许是java小程序或其他形式的flash?
Are there any options for recording audio in a GWT application ?
Options seem to include flex, perhaps a java applet or some other form of flash ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,目前似乎没有任何方法可以仅使用 JavaScript 来录制音频,因此单独使用 GWT 是不可能的(因为 GWT 编译器仅生成 JavaScript)。
不过,Mozilla 的 Jetpack 项目包含一个提议的音频 API,这可能使之成为可能。请记住,这是一项前沿功能,可能在很长一段时间内不会得到广泛支持。
这个答案可能会有所帮助,因为它提出了类似的问题: 如何从基于 Javascript 的网络应用程序录制音频?
Unfortunately it doesn't appear that there is any way to record audio using just JavaScript currently, so it won't be possible using GWT alone (since the GWT compiler only produces JavaScript).
However, Mozilla's Jetpack project includes a proposed Audio API that may make it possible. Keep in mind that this is a cutting-edge feature and will probably not be widely supported for a very long time.
This answer might be helpful, since it's asking a similar question: How does one record audio from a Javascript based webapp?
对于我们的 GWT Web 应用程序,我们使用 Javasonics 制作的 Java 小程序。他们有一个免费(有限制)版本可供您使用。它工作得很好并且支持多种音频格式。该小程序在 Windows、Linux 和 Mac 上运行没有问题。
您可以使用 JavaScript 控制小程序。在 GWT 客户端代码中,您必须使用 JSNI 在真实 JavaScript 代码和 GWT 代码之间进行交互。
然而,GWT 中似乎有一个错误,使小程序显示在对话框之上,这非常烦人。我们通过在显示对话框时将小程序的可见性设置为 false 来解决此问题。
For our GWT web application we use a Java applet made by Javasonics. They have a free (with limitations) version that you can use. It works very well and supports several audio formats. The applet worked without problems on Windows, Linux and Mac.
You can control the applet using JavaScript. In your GWT client code, you will have to use JSNI to interface between the real JavaScript code and your GWT code.
However, it seems that there is a bug in GWT that makes the applet display on top of dialogs and it is quite annoying. We dealt with this issue by setting the applet's visibility to false when displaying dialog boxes.