Hello,
I’m trying to play some background music. Here is my code:
[java]AudioNode m = new AudioNode(RenderData.getAssetManager(), “assets/Sounds/schumann.ogg”,false);
RenderData.getRootNode().attachChild(m);
m.setDirectional(false);
m.setPositional(false);
m.setLooping(true);
System.out.println(m);
RenderData.getAudioRenderer().playSource(m);[/java]
When I go to create the AudioNode, I get a NullPointerException pointing to here, which is the constructor for AudioNode:
[java]public AudioNode(AssetManager manager, String name, boolean stream) {
this();
this.key = new AudioKey(name, stream);
this.data = (AudioData) manager.loadAsset(key); //This line
}[/java]
What am I doing wrong?
Thanks,
Sauer
Your RenderData.getAssetManager() method returns null