Wav playback doesn't make a sound in the simulator
shai-almog opened this issue · comments
See test case: https://github.com/shai-almog/testwav
There were two problems with this sample. Fixing both of these problems resulted in the wav file playing as expected in my test.
Problem 1: The sound is never played. Link
InputStream is = Display.getInstance().getResourceAsStream(getClass(), "/" + fileName);
m = MediaManager.createMedia(is, "audio/wav");
Need to add m.play();
after loading the stream.
Problem 2: The name of the Wav file is incorrect. Link
new RegularSound("playwav.wav");
Should be
new RegularSound("mywav.wav");