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.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- Can we recover audio from MFCC coefficients?
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
AFAIK there is no way, at least without other command line utilities. You could try using mplayer, but I guess the situation here is the same as with ffmpeg. :)
You could of course upload the executable and run it through PHP if your host's policies allow this (safe mode, SELinux).
Just use
ffmpeg
. You can simply download a binary offfmpeg
(look for "static builds"), and then point your script to the binary. There is no need to install it so there should be no permission issues.Simple answer: You can't convert audio files in pure PHP. I would suggest you to create/ search for a web-service to accomplish that task. (For example: maybe you can make use of this through curl).
Use SoX - the Swiss Army knife of sound processing. Very easy to use.
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.
Example with PHP:
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 is very mature project! Here is the link: http://sox.sourceforge.net/
Here are some examples I googled for you: http://www.thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/