合并两个mp3 php [英] Merge two mp3 php

查看:136
本文介绍了合并两个mp3 php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道使用PHP合并两个MP3文件的课程?

Do you know a class to merge two MP3 files using PHP?

我在Google上找不到任何内容。

I've found nothing on Google.

推荐答案

如果通过合并,你的意思是将一个音频放在另一个上,那么请忽略这个答案。

如果你不想重新编码MP3,你可以随便附加它们。我知道这适用于MPEG电影,所以我想它也适用于MP3。另一种选择是将音频文件添加到没有压缩的Zip存档,然后将扩展名重命名为.mp3。

If you dont want to re-encode the MP3s, you can probably just append them. I know this worked for MPEG movies, so I guess it could work for MP3s too. Another option would be to add the audo files to a Zip Archive with no compression and then rename the extension to .mp3.

我做了一个快速测试,这个

I did a quick test and this

file_put_contents('combined.mp3',
    file_get_contents('file1.mp3') .
    file_get_contents('file2.mp3'));

工作正常。 ID3标签将是错误的,但生成的文件包含两个音频文件。 对于其他一些可能的陷阱,请参阅Pekka答案中的链接

worked fine. The ID3 tags will be wrong, but the resulting file contains both audio files. For some other possible gotchas, see the link in Pekka's answer.

此外,一些快速谷歌搜索导致

Also, some quick googling resulted in

  • http://www.sourcerally.net/Scripts/20-PHP-MP3-Class
  • http://codingforums.com/showthread.php?t=169069

和一些讨论

  • http://ask.metafilter.com/21381/Merge-mp3s-with-PHP

这篇关于合并两个mp3 php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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