如何在Java中呈现波形
我有这个小代码,可以在 java 中执行录制。我希望添加某种功能来绘制此内容的视觉呈现。您建议我如何处理这个问题? (我对 java 很陌生)
我希望视觉呈现显示为当前现有图像的前景。
I've got this small code that performs recording in java. I whish to add some sort of functionality to draw a visual presentation of this. How would you advise me to approach this? (I am very new to java )
I'd like the visual presentation to appear as a foreground of a current existing image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 wav 文件(标头)中跳过前 44 个字节,然后使用此函数读取数据:
每个通道一个值。这将为您提供 -1 到 1 之间的数字,您可以将其绘制在图表上。我相信会有人帮忙画的。
Skip first 44 bytes from the wav file (header), then read data using this function:
One value for each channel. This will give you number between -1 and 1, which you can draw on your graph. I believe someone else will help with drawing it.
您可以使用 Java Sound API(AudioSystem、AudioInputStream、AudioFormat)来完成此操作。该 API 允许您逐字节读取 .wav 文件,您还可以从 AudioFormat 对象获取比特率、vbr、质量信息。然后您可以使用 AWT、Swing 或任何您喜欢的工具绘制此信息。
You may be able to do this with Java Sound API (AudioSystem, AudioInputStream, AudioFormat). The API lets you read .wav files byte by byte, and you can also get bitrate, vbr, quality information from AudioFormat object. You can then draw this information with AWT, Swing or whatever you like.