Java AudioClip播放音频

目前Java有两种处理音频的方法,一个是简单的Applet的AudioClip,另一个则是有些难度的JavaSound

以下简单介绍AudioClip用法,相当简单:

(1)void play() //Start the audio. Furthermore, if you call this method, the audio will start from beginning.

(2)void stop() //Stop the audio.

(3)void loop() //Start the audio and loop it.

An example:

AudioClip audioClip=getAudioClip(getCodeBase(),"directory of audio");

audioClip.play();

你可能感兴趣的:(java,audio,applet)