JAVA添加背景音乐播放错误
importsun.audio.*;importjava.io.*;publicclassAudio{publicstaticvoidmain(Stringaf[])th...
import sun.audio.*;
import java.io.*;
public class Audio
{
public static void main(String af[]) throws IOException
{
InputStream in = new FileInputStream("开场.wav");
AudioStream as = new AudioStream(in);
AudioData data1 = as.getData();
ContinuousAudioDataStream as1 = new ContinuousAudioDataStream(data1);
AudioPlayer.player.start(as1);
}
}
错误代码
Exception in thread "main" java.io.IOException: could not create AudioData object
at sun.audio.AudioStream.getData(Unknown Source)
at Audio.main(Audio.java:13) 展开
import java.io.*;
public class Audio
{
public static void main(String af[]) throws IOException
{
InputStream in = new FileInputStream("开场.wav");
AudioStream as = new AudioStream(in);
AudioData data1 = as.getData();
ContinuousAudioDataStream as1 = new ContinuousAudioDataStream(data1);
AudioPlayer.player.start(as1);
}
}
错误代码
Exception in thread "main" java.io.IOException: could not create AudioData object
at sun.audio.AudioStream.getData(Unknown Source)
at Audio.main(Audio.java:13) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询