使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 11:53:07  来源:igfitidea点击:

Generating an mp3/wav/ogg Waveform using Java

javaaudiowaveform

提问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.

我想生成一个音频波形作为图像,并在加载轨道时,将加载波形图像。


  1. enter image description here

  1. 在此处输入图片说明

回答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

用于为音频文件创建 PNG 波形的 Java 程序

How can I draw sound data from my wav file?

如何从我的 wav 文件中提取声音数据?

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.

还有很多其他的答案。