使用 Java 生成 mp3/wav/ogg 波形
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13209099/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Generating an mp3/wav/ogg Waveform using Java
提问by user962206
Like soundcloud and zippyshare1, how can I generate an audio waveform image using java? are there any frameworks or open source libraries available for such case?
像 soundcloud 和 zippyshare 1 一样,如何使用 java 生成音频波形图像?是否有任何框架或开源库可用于这种情况?
I wanted to generate an audio waveform as an image, and upon loading a track, the waveform image with will be loaded.
我想生成一个音频波形作为图像,并在加载轨道时,将加载波形图像。
回答by Andrew Thompson
Start with this answer. The "further processing.." in this case might be to add each instantaneous value to a GeneralPath
, then (scale that path to fit within the painting area and) draw it.
从这个答案开始。在这种情况下,“进一步处理..”可能是将每个瞬时值添加到 a GeneralPath
,然后(缩放该路径以适应绘画区域并)绘制它。
回答by Bjorn Roche
Here are two questions with answers on SO:
以下是关于 SO 的两个问题的答案:
Java Program to create a PNG waveform for an audio file
How can I draw sound data from my wav file?
I like my answer to the second question the best because it explains how to do it in all cases, but it doesn't give code.
我最喜欢我对第二个问题的回答,因为它解释了在所有情况下如何做到这一点,但它没有给出代码。
There are lots of other answers, too.
还有很多其他的答案。