내 응용 프로그램에 문제가 있습니다. 이클립스에서 앱을 실행할 때 소리가 잘 들리지만 실행 가능한 항아리로 앱을 내 보내면 소리가 나지 않는다. 사운드가 재생됩니다병으로 보내기 한 후 소리가 들리지 않습니다.
방법 :
public static synchronized void playSound()
{
new Thread(new Runnable()
{
// The wrapper thread is unnecessary, unless it blocks on the
// Clip finishing; see comments.
public void run()
{
try
{
Clip clip = AudioSystem.getClip();
AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResourceAsStream("sound.wav"));
clip = AudioSystem.getClip();
clip.open(inputStream);
clip.start();
}
catch (Exception e)
{
System.err.println(e.getMessage());
}
}
}).start();
}
실수가 될 수 있습니까?
파도 파일이 JAR에 있습니까? –
jar 파일의 압축을 풀어보고 파일을 찾았습니다. – Sk1X1