Hello all,
I have a strange problem with sound on the Java target. Basically if I load a sound using getSound(), it doesn't work (no sound), however if I use getMusic() then it works fine.
I would normally suspect something wrong in the .wav file itself or in my Java setup, however since it does work when I use getMusic() I guess there must be something else...
More info:
- My environment: OpenJDK 1.8.0_141 on Ubuntu 14.04.5.
- PlayN 2.1-SNAPSHOT
- Simple test program follows
public class HelloPlayN extends SceneGame {
public HelloPlayN (Platform plat) {
super(plat, 33); // update our "simulation" 33ms (30 times per second)
// create and add background image layer
Image bgImage = plat.assets().getImage("images/bg.png");
ImageLayer bgLayer = new ImageLayer(bgImage);
// scale the background to fill the screen
bgLayer.setSize(plat.graphics().viewSize);
rootLayer.add(bgLayer);
Sound dropSound = plat.assets().getSound("sounds/drop");
Sound dropMusic = plat.assets().getMusic("sounds/drop");
// Doesn't work
dropSound.play();
// Works
//dropMusic.play();
}
}
Any hints?
Guillermo