开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜