问题描述
我要AMR音频文件转换为MP3。我怎样才能让它在PHP没有FFMPEG(我没有权限在服务器上安装它)。请帮我。
I need to convert AMR audio file to MP3. How can I make it in PHP without FFMPEG (i have no permissions to install it on the server). Please help me.
推荐答案
使用使用SoX - 无害化处理的瑞士军刀。使用非常简单。
Use SoX - the Swiss Army knife of sound processing. Very easy to use.
这是一个命令行工具,不是一个PHP库,以便从PHP使用您需要执行一个shell命令并在你的code得到的结果。我曾在几个项目中使用它。
It is a command line tool not a PHP library so to use from PHP you need to execute a shell command and get the result with in your code. I have used it with in few projects.
用PHP示例:
<?php
exec('sox /mypath/my_audio.amr /mypath/my_audio.mp3');
?>
Sox是一个跨平台(Windows,Linux和MacOS X系统等)的命令行实用工具,可以转换的计算机的音频文件不同的格式在为其他格式。它也可以应用各种效果于这些声音文件,并作为额外的奖励,SOX可以在大多数平台上播放和录制音频文件。
SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.
Sox是非常成熟的项目!这里是链接:
SoX is very mature project! Here is the link: http://sox.sourceforge.net/
下面是一些例子我用Google搜索你:
http://www.thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/
Here are some examples I googled for you:http://www.thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/
这篇关于转换PHP中的音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!