使用PHP在Linux Debian中合并MP3文件 [英] Merging MP3 files in Linux Debian using PHP

查看:547
本文介绍了使用PHP在Linux Debian中合并MP3文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux Debian系统上,使用PHP 5.2将几个MP3文件的内容合并为一个最简单的方法是什么?我发现一些脚本应该仅在PHP中执行,但是它们似乎是错误的。也许有一种方法可以使用命令行程序来完成此任务,我可以在我的Linux Debian机器上安装?

解决方案

这一点: http://lists.mplayerhq.hu/pipermail/ ffmpeg-user / 2009-September / 022171.html



首先你必须安装sox。 sudo apt-get install sox。

  $ sox first.mp3 -r 44100 -c 2 -s -w first.raw 
$ sox second.mp3 -r 44100 -c 2 -s -w second.raw
$ cat first.raw second.raw> concatenated.raw
$ sox -r 44100 -c 2 -s -w concatenated.raw concatenated.mp3

您可以使用exec()从php执行所有这些命令。


What's the easiest way to merge the contents of several MP3 files into one using PHP 5.2 on Linux Debian system? I found some scripts that are supposed to do in PHP only, but they seem to be buggy. Perhaps there is a way to accomplish this task using command line programs, that I could install on my Linux Debian machine?

解决方案

check this: http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2009-September/022171.html

first you have to install sox. sudo apt-get install sox.

$ sox first.mp3 -r 44100 -c 2 -s -w first.raw
$ sox second.mp3 -r 44100 -c 2 -s -w second.raw
$ cat first.raw second.raw > concatenated.raw
$ sox -r 44100 -c 2 -s -w concatenated.raw concatenated.mp3

you can execute all these commands from php with exec().

这篇关于使用PHP在Linux Debian中合并MP3文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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