AudioNode(args) deprecated, how to initiate audio?

Hello all,

I’m trying to add audio to my game but I don’t know how I should. The tutorial (Hello Audio) tells me I should initiate an AudioNode using “AudioNode audio = new AudioNode(assetManager, “Sound/boom.wav”);”, but Eclipse tells me this way of defining an AudioNode is deprecated. How should I go about doing this?

Thanks!

Eclipse should tell you the Deprecation Message.
http://javadoc.jmonkeyengine.org/com/jme3/audio/AudioNode.html#AudioNode-com.jme3.asset.AssetManager-java.lang.String-
In doubt, always check the javadoc :slight_smile:
We should change the wiki accordingly, though.

Ah nice, thanks a lot! I’m relatively new to Eclipse, still have to find out where they put those kinds of things haha

When you use Auto-Complete during coding it will show you all available constructors, the deprecated ones are striked-through and you can see a little descriptive text beneath.

Btw: If you are new to eclipse, why not giving the Netbeans IDE/our SDK a try? It will help you during Game Development since the whole Wiki (maybe a bit outdated) is contained and only one f1-press away.

You also have several tools and graphical editors and stuff.

1 Like

Yes, when starting with both jME and a Java IDE - I would recommend what @Darkchaos said too. It’s great fun to work with the jME SDK (a variant of Netbeans).