java 利用AudioPlayer循环播放音乐

					AudioStream as = null;
					AudioData ad=null;
					try {
						as = new AudioStream(类名.class.getClassLoader().getResourceAsStream("resource/***.wav"));
						ad = as.getData();
					} catch (IOException e) {e.printStackTrace();}
					//设置循环播放
					ContinuousAudioDataStream cads = new ContinuousAudioDataStream(ad);
					//循环播放开始哦
					AudioPlayer.player.start(cads);
					......
					//循环播放停止
					AudioPlayer.player.stop(cads);

你可能感兴趣的:(java 利用AudioPlayer循环播放音乐)