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

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

问题描述

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

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?

推荐答案

检查这个:http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2009-September/022171.html

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

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

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

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

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

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