java的MP3 /音频编辑/修剪库 [英] java mp3/audio editing/trimming library

查看:1105
本文介绍了java的MP3 /音频编辑/修剪库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个Java库,让我来调整的音频文件,这样我可以拉出来并保存的音频文件的秒X数量。理想情况下,我在寻找的东西,这将是像一个音频文件SUBSTR。如果我123秒至153秒想我能做到:

I am looking for a java library that will allow me to "trim" an audio file so that I can pull out and save X amount of seconds of an audio file. Ideally, I am looking for something that would be like a substr for an audio file. If I want from 123 seconds in to 153 seconds in I would be able to do:

coollib.load('bigfile.mp3');    
coollib.trimAudioSeconds(123,30);
coollib.export('newfile.mp3');

我已经看到了这个帖子:

I have seen this post:

<一个href=\"http://stackoverflow.com/questions/86083/any-good-recommendations-for-mp3sound-libraries-for-java\">http://stackoverflow.com/questions/86083/any-good-recommendations-for-mp3sound-libraries-for-java

但它没有对我的追求SUBSTR什么。我希望有人需要这个功能之前,所以他们会知道什么方向指向我。

But it didn't have anything about my substr quest. I am hoping someone has needed this functionality before so they will know exactly what direction to point me.

谢谢!

推荐答案

我不知道现有的库,但你可以做的是阅读的比特率信息的文件头,再乘上你想秒进去后,读取文件的这么多字节,把它们扔掉。然后你在正确的点开始录制,看了这么多字节,并停止。

I don't know about an existing library, but what you can do is read the file header for bitrate information, then multiply that by the seconds you want to go in, read so many bytes of the file and throw them away. Then you're at the right point to start recording, read so many bytes, and stop.

一个普通的mp3库应该能够告诉你关于比特率,而不必自己读头。

A regular mp3 library should be able to tell you about bitrate without your having to read the header yourself.

此外,还有的可变比特率文件的问题...

Then there's the problem of variable bitrate files...

这篇关于java的MP3 /音频编辑/修剪库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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