如何在PHP中将.wav转换为.mp3文件 [英] How to convert .wav to .mp3 file in php

查看:636
本文介绍了如何在PHP中将.wav转换为.mp3文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用CodeIgniter框架开发网站,并且在其中一个流程中,我需要下载.wav音乐文件并将其转换为.mp3文件. 所有的编码只需要在PHP中完成,而我不能使用Ruby或Java来完成.

我目前正在共享环境中托管,即Dreamhost.

所以请让我知道如何解决这个问题.

解决方案

使用 FFMPEG .有一个 PHP扩展,但是我发现仅调用exec()会获得更好的成功.我使用过的大多数主机(甚至是共享主机)都会安装(如果尚不可用的话).

编辑:Dreamhost为您提供了此功能.请参见: http://wiki.dreamhost.com/FFmpeg

这是: http://wiki.dreamhost.com/Php-ffmpeg

I am currently developing a website using the CodeIgniter framework and in one of the Process I need to download a .wav music file and convert it to .mp3 file. All the coding needs to be done only in PHP and I cannot use Ruby or java to do so.

And I am currently hosting on a shared env i.e. Dreamhost.

So please let me know how to work out this problem.

解决方案

Use FFMPEG. There is a PHP extension for it, but I've found better success just calling exec(). Most hosts I have used (even shared hosting) will install it if it isn't already available.

Edit: Dreamhost provides this for you. See this: http://wiki.dreamhost.com/FFmpeg

And this: http://wiki.dreamhost.com/Php-ffmpeg

这篇关于如何在PHP中将.wav转换为.mp3文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆