1
코딩의 멍청한 문제가 있지만 컴퓨터 과학 수업에서 Pacman을 만들었는데 어떤 이유로 인해 오디오가 작동하지 않습니다.오디오 파일이 재생되지 않는 이유를 알 수없는 이유 (Java)
기본적으로 다음은 내가 작성한 것입니다.
public void paint(Graphics g)
{
PlayAudio();
//.... a lot of other stuff
}
내 PlayAudio 방법 :
public void PlayAudio()
{
try
{
Clip clickClip = AudioSystem.getClip();
File filePath = new File("opening.wav");
AudioInputStream ais = AudioSystem.getAudioInputStream(filePath);
clickClip.open(ais);
clickClip.start();
}
catch (Exception e)
{
e.printStackTrace();
}
}
그것은 컴파일하고 실행하지만 오디오 파일이 재생되지 않습니다. 도와 주셔서 감사합니다!
- 가
.wav
파일입니다내 opening.wav이 있음을 확인했다.
- 이름이 있습니다.
- 같은 디렉토리에 있습니다.