如何“修剪"; Java,C#或PHP的音频文件(用于浏览器) [英] How to "Trim" an Audio File in Java, C# or PHP (For Browser)
问题描述
我正在尝试创建一个需要此功能的Web应用程序:
I'm trying to create a web application which requires this feature:
假设我有一个.mp3文件,我想选择/上传此文件,然后从0:15到0:30(例如)制作一个新文件,然后另存为新的.mp3/.哇.
Suppose I have a .mp3 file, I want to select/upload this file, and then, make a new file of it from 0:15 to 0:30 (example), and then save as new .mp3/.wav.
由于它应该在Web上运行,所以在PHP中更可取,但是我高度怀疑是否有可能接受Java(Applets)或C#(ASP.NET).
As it's supposed to go on web, would be preferrable in PHP, but as I highly doubt it's possible, Java(Applets) or C#(ASP.NET) are acceptable and highly appreciated.
谢谢.
推荐答案
最好的方法是使用 FFMPEG 一个>.有一个 PHP扩展,但是我通常发现,最简单的称呼它是与 exec().
The best way to do this is with FFMPEG. There is a PHP extension for it, but I've generally found that it is easiest to just call it with exec().
ffmpeg -ss 00:00:15 -t 15 -i yourfile.mp3 -acodec copy outputfile.mp3
此处的更多信息: http://www.catswhocode. com/blog/19-ffmpeg-commands-for-all-needs
这篇关于如何“修剪"; Java,C#或PHP的音频文件(用于浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!