Is it possible to implement music/SFX in game made using JMonkey? If yes, how did you do it? What did you use?
Admittedly I don't have a ton of experience with JMonkey, however this page seems to have enough information to explain the system.
From what I can read, JMonkey's audio system uses a listener/source system. Regardless, it seems simple enough to implement and should be a fairly trivial task.
Edit: After reading the article, I'll try to explain it more here:
Each sound uses an instance of AudioNode, created like this:
To load the sounds themselves, simply create a new instance like so:
nodey = new AudioNode(assetManager, "a-file.wav", false);
The true/false sets if the sound will be streamed or not. For long sounds (think things like in-game Music,) this should be set to true, however shorter sounds, this should not be streamed.
Once you load the sound, you can then attach to the root node, and then either play it using play() or playInstance():
rootNode.attachChild(nodey); /** Repeat playing if sound is ambient (Waterfall, wind etc.) [Note: nodey.setLooping(true) should be called before adding to the root node if the sound will loop] */ nodey.play(); /** Play as instance (Footstep, Gunshot, etc.) */ nodey.playInstance();
For playback, a "listener" object must be created, and said "listeners" proprieties should be updated as the camera moves.