Merging MP3 files in Linux Debian using PHP(使用 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 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 PHP 在 Linux Debian 中合并 MP3 文件


基础教程推荐
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01