如何在我的网站中嵌入 Flash 录音机
有人可以指导我完成在我的网站上嵌入音频录制小部件的过程吗?人们可以在其中录制短(约 5 秒)的语音剪辑?我完全没有使用 Flash 的经验,但由于 HTML5 尚未出现,所以它是必要的。
Can somebody guide me through the process of embedding an audio recording widget on my site, where people can record short (~5 secs) voice clips? I have absolutely no experience with Flash but since HTML5 is not there yet, it's necessary.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@pkyeck 不,您可以录制音频并将其全部保存在客户端上,而无需服务器。查看这个人的博客,我使用了他的代码并修改了它。它可以录制音频并将 mp3 保存在您的硬盘上。我修改了代码供我个人使用并添加了超时。不幸的是,您需要学习一些 Flash 来修改代码,但它确实很容易上手。
他在博客的第 6 条评论中发布了源代码。
编辑:要“指导您将音频嵌入到您的网站中”,只需将这个人的源代码加载到 Flash CS5.5 Professional 中并发布到 HTML 文件,然后获取生成的代码并将其放入进入您的网站。如果您没有 CS5.5 Professional,那么这个钱还是值得的,但您也可以从 Adobe 网站下载免费试用版。
@pkyeck No, you can record audio and save it all on the client without a server. Check out this guy's blog, I used his code and modified it. It records audio and saves mp3's on your hard drive. I modified the code for my personal use and added a timeout. Unfortunately you need to learn some Flash to modify the code, but it's really easy to pick up.
He posts the source code on the 6th comment on his blog.
Edit: To "guide you to embed the audio into your site", just load this guy's source code into Flash CS5.5 Professional and publish to an HTML file, and then grab the generated code and put it into your website. If you don't have CS5.5 Professional it's worth the money, but you can also download a free trial from Adobe's website.
这取决于您要在哪里录制音频。如果您希望录制音频并将其保存到访问者计算机上,那么 Stefan 是对的,但如果您希望将音频文件保存在您的服务器上,那么您需要服务器端 Flash 软件,或者 red5,这是一个开源替代品。您还可以使用各种可嵌入的插件,这些插件可以让您记录到插件的服务器,然后可以从您的页面访问该服务器。
http://cooltoolsforschools.wikispaces.com/Audio+Tools
It depends upon where you want to record the audio. If you want the audio to be recorded and saved to the visitors computer then Stefan is right, but if you want to audio file to be saved on yours server then you need the server side Flash software, or red5 which is an open source alternative. You can also use various embeddable plugins that will let you record to the plugin's server which can then be acessed from your page.
http://cooltoolsforschools.wikispaces.com/Audio+Tools
有 3 种方法可以在网站中嵌入录音:
Flash 捕获麦克风声音数据,将其以 wav 形式存储在 RAM 中,使用 mp3 转换库将其转换为 mp3,然后使用 POST 和服务器端上传脚本将其上传到 Web 服务器。
建议在短录音时使用此方法。
Flash 捕获麦克风数据,使用内置音频编解码器(Nellymoser ASAO 和 Speex)对其进行编码,并将其流式传输到媒体服务器(Red5 是免费且开源的,Wowza 等),它保存在 .flv 文件中。
由于数据是流式传输的,因此建议长时间录制时使用此方法。如果计算机/浏览器崩溃,您不会丢失任何记录的数据。
以上两种方法都允许您限制录制时间。
HTML Media Capture 通过启动操作系统的本机音频录制应用程序在移动设备上工作录制音频,然后将文件上传到网络服务器。根据设备的不同,您最终会得到 .3ga 或 .mov 文件。
它在 Android 上的外观如下:
注意:iOS9 及之前版本上的 Mobile Safari 在使用 HTML Media Capture 录制音频时将调出本机照片/视频录制应用程序。
您可以将桌面上的录制时间限制为 5 秒。不幸的是,在移动设备上这是不可能的。
您实际可以嵌入的录音应用程序示例:
There are 3 ways to embed audio recording in a website:
Flash captures the mic sound data, stores it in RAM as wav, converts it to mp3 using mp3 conversion library and then uploads it to the web server using POST and a server side upload script.
This method is recommended for short recordings.
Flash captures the mic data, encodes it using builtin audio codecs (Nellymoser ASAO and Speex) and streams it to a media server (Red5 is free and open source, Wowza, etc.) where it is saved in .flv files.
Because the data is streamed this method is recommended for long recordings. If the computer/browser crashes you do not loose any recorded data.
Both of the above methods allow you to limit the recording time.
HTML Media Capture works on mobile by bringing up the OS' native audio recording app to record the audio and then upload the file to the web server. Depending on the device you'll end up with .3ga or .mov files.
Here's how it looks on Android:
Note: Mobile Safari on iOS9 and previous versions will bring up the native photos/video recording app when using HTML Media Capture to record audio.
You can limit the recording time to 5 seconds on desktop. Unfortunately on mobile it is not possible.
Example voice recording apps that you can actually embed: