开发者

What's the easiest way to produce an X Hz sound wave in Java?

开发者 https://www.devze.com 2023-02-09 15:55 出处:网络
It would also be great if it was fairly easy to export the wave so that it later can be drawn (visualized using for example Can开发者_如何学JAVAvas).

It would also be great if it was fairly easy to export the wave so that it later can be drawn (visualized using for example Can开发者_如何学JAVAvas).

To clarify: I want to be able to hear a X Hz wave, and preferably draw it.


for (double t = 0.0; t < maxTime; t += dt)
{
  double value = amplitude*sin(2.0*Math.PI*frequency*t);
} 

Put the values out to the wave format or plotting program of your choice.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号