@Override
    public void onAction(String name, boolean keyPressed, float tpf) {
      if (name.equals("Shoot") && !keyPressed) {
        audio_gun.playInstance(); // play each instance once!
      }
    }
Defining the "Shoot" action: Play a gun sound.
jme3-examples/src/main/java/jme3test/helloworld/HelloAudio.java