Well I’m having problems with EasyOgg in that it’s not playing anything, and it’s not throwing any exceptions. I used a random ogg that plays through xmms but won’t in my application:
import java.io.IOException;
import java.util.Scanner;
import org.newdawn.easyogg.OggClip;
public class SoundTest
{
OggClip clip;
public static void main(String args[])
{
new SoundTest();
}
public SoundTest()
{
try
{
clip = new OggClip("startup2.ogg");
clip.loop();
System.out.println("sound looping!");
} catch (IOException e)
{
e.printStackTrace();
}
Scanner input=new Scanner(System.in);
do
{
System.out.println("Quit?");
}
while(!input.nextLine().equals("Y"));
}
}
sound looping! prints, and Quit? prints, but there’s no sound playing ???
EDIT:debugger output with breakpoint on clip.loop();
http://dec19.imghost.us/uEzu.png
EDIT2: adding Thread.sleep(100); after clip.loop(); makes it work, but is there a more reliable way to ensure that the sound will play?