开发者

How do i convert wav file to mp3 file if i have url of file using php?

I have a url of the wav file http://xyz.com/recordings/employees/test.wav

What i want to know is how can i change this file into mp3 format and store it in a particular location using php script because this file is located in some other开发者_如何学Go server?

I know about ffmpeg but not sure whether it will work or not.


I hope you have linux:

exec('wget http://xyz.com/recordings/employees/test.wav');
exec('ffmpeg -i test.wav test.mp3');
exec('mv test.mp3 /youlocation/test.mp3');


Thats usually no problem you may download this file to your webserver to a temporary folder. Than you have to convert it. There is e.g. a ffmpeg extension to php but not shipped with the php distribution afaik.

But even if you do not have this you can invoke a commandline on e.g a linux shell

ffmpeg -i /sometmpfolder/tmp.wav destination.mp3


I have found an api which does this conversion process. The link for this is: Api for conversion

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜