php 如何使用PHP、FLASH录制语音文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2065797/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to record voice files using PHP, FLASH
提问by Kunal
I am developing an application where I need to record voice(for those who does not have a webcam so they can use only microphone to record voice) or video(those who have a a webcam - like laptop or external) files and save them on server, thereafter save the file name and logged in users id on database for later access.
我正在开发一个应用程序,我需要在其中录制语音(对于那些没有网络摄像头的人,因此他们只能使用麦克风来录制语音)或视频(那些有网络摄像头的人 - 如笔记本电脑或外部)文件并将它们保存在服务器上, 然后将文件名和登录用户 ID 保存在数据库上以供以后访问。
I know I need to use some sort of flash app for this. But is there any free one which could server this purpose or even if there are paid ones which could serve this purpose that would be great. I tried google but may be I was not being able to go after the proper term or something, I could not succeed finding a proper solution for this.
我知道我需要为此使用某种 Flash 应用程序。但是,是否有任何免费的可以实现这一目的,或者即使有付费的可以实现这一目的,那就太好了。我试过谷歌,但可能是我无法遵循正确的术语或其他东西,我无法为此找到合适的解决方案。
Please, help me out!
请帮帮我!
采纳答案by Donny Kurnia
I have same feature in our latest project, the client want to have video recording from webcam and the video appear in the user's profile page.
我在我们最新的项目中具有相同的功能,客户希望从网络摄像头录制视频,并且视频出现在用户的个人资料页面中。
For the server, we implement the RED5 server. It need a Java virtual machine in your hosting. You can read the detail requirement and installation instruction in the website.
对于服务器,我们实现了RED5 服务器。它需要在您的主机中安装一个 Java 虚拟机。您可以在网站上阅读详细要求和安装说明。
To handle recording, we develop our own flash application, because the client request a custom interface to match with the overall website interface. I don't know the detail, since we outsource it to a fellow flash developer. Maybe you can see follow this thread, the development of flash recording by JeroenW.
为了处理录音,我们开发了自己的 Flash 应用程序,因为客户端请求自定义界面以匹配整个网站界面。我不知道细节,因为我们将它外包给了一个 Flash 开发人员。也许你可以看到关注这个线程,JeroenW 开发闪存。
To play recorded video, you can use any flash video player that support playing rtmp video source. You cannot play the recorded flv file in RED5 directly, since the file lack of metadata required by the player. Serving the recorded file as rtmp is done by RED5.
要播放录制的视频,您可以使用任何支持播放 rtmp 视频源的 Flash 视频播放器。您不能直接在 RED5 中播放录制的 flv 文件,因为该文件缺少播放器所需的元数据。将录制的文件作为 rtmp 提供服务是由 RED5 完成的。
回答by Sajith Amma
You can do that simply using jRecorder, a jQuery plugin. You don't even need a Flash Media Server or RED server. JRecorder is same as jPlayer, you can use jQuery and HTML to design your recorder and you don't even need Flash or Action script knowledge for this.
你可以简单地使用 jRecorder,一个 jQuery 插件。您甚至不需要 Flash Media Server 或 RED 服务器。JRecorder 与 jPlayer 相同,您可以使用 jQuery 和 HTML 来设计您的记录器,您甚至不需要 Flash 或 Action 脚本知识。
jRecorder uses 1 pix hidden swf file which manages all the recording / previewing and sending the file data (wav file) to a URL you defined (Where you can write code in PHP or Java to receive a POST file)
jRecorder 使用 1 pix 隐藏 swf 文件,该文件管理所有记录/预览并将文件数据(wav 文件)发送到您定义的 URL(您可以在其中用 PHP 或 Java 编写代码以接收 POST 文件)
It is quite simple and tidy.
它非常简单和整洁。
You can download this Plugin from:
您可以从以下位置下载此插件:
回答by Pekka
There are Open Source solutions but you will need an own server to run them. There is no way to run these things from shared hosting except if your provider is really nice, and ready to install the necessary software.
有开源解决方案,但您需要自己的服务器来运行它们。除非您的提供商非常好并且准备安装必要的软件,否则无法从共享主机运行这些东西。
I asked the same questiona few weeks back, check out the answers.
几周前我问了同样的问题,看看答案。
回答by Matti Lyra
In addition to red5there is Adobe's own Flash Media serverthat allows you to record audio/video straight to the server.
除了red5之外,还有 Adobe 自己的Flash Media 服务器,它允许您将音频/视频直接录制到服务器。
Or if you feel geeky you might be able to put together your own solution for this using a socket connection to the server and decoding the stream yourself on the server side. You should be able capture the audio/video locally into memory and then feed the byte stream up to your own server application.
或者,如果您觉得很古怪,您可以使用与服务器的套接字连接并在服务器端自己解码流来为此组合您自己的解决方案。您应该能够在本地将音频/视频捕获到内存中,然后将字节流提供给您自己的服务器应用程序。
回答by Michael J. Calkins
This question when googling "How to record audio php" comes up first so here for anyone from the future.
这个问题首先出现在谷歌搜索“如何录制音频 php”时,因此对于未来的任何人来说都是如此。
A simple way to record audio with flash and save it with PHP: https://github.com/clouddueling/SimpleRecorder
一种用flash录制音频并用PHP保存的简单方法:https: //github.com/clouddueling/SimpleRecorder
Record audio, post audio data to your choice of url.
录制音频,将音频数据发布到您选择的网址。
回答by J.Hunt
You could try recordmp3online.comwhich has an SDK. The nice thing about this one, is that it doesn't need a third party server(ala Red5), and supports mobile devices that don't have flash installed.
您可以尝试具有 SDK 的recordmp3online.com。这个的好处是它不需要第三方服务器(ala Red5),并且支持没有安装闪存的移动设备。

