Sine Wave Sound Generator in Java

后端 未结 7 1995
时光说笑
时光说笑 2020-12-05 01:22

What\'s the simplest way to generate a sine wave sound at any frequency in Java? A sample size more than 2 bytes would help, but it doesn\'t really matter.

7条回答
  •  不知归路
    2020-12-05 02:00

    Use the Java Sound API, and Math.sin to create the actual wave levels.

    http://www.developer.com/java/other/article.php/2226701 has an excellent tutorial around this that I had referenced some time ago. http://jsresources.org/examples/ was another useful reference.

提交回复
热议问题