backgroundMusic= new Entity("BACKGROUND"); soundRenderer.addSource(backgroundMusic); soundRenderer.getPlayer(backgroundMusic).setPosition(soundPosition); soundRenderer.getPlayer(backgroundMusic).setMaxDistance(30.0f);
e= new Entity("back"); soundRenderer.addSource(e); soundRenderer.getPlayer(e).setPosition(soundPosition); soundRenderer.getPlayer(e).setMaxDistance(30.0f);
	public void init(SceneEnabledGame game) {		this.game= game;		timer= game.getTimer();		text= new Text("Playing sound");		TextureState ts= game.getDisplaySystem().getRenderer().getTextureState();		ts.setEnabled(true);		ts.setTexture(			TextureManager.loadTexture("data/Font/font.png", Texture.MM_LINEAR, Texture.FM_LINEAR, true));		text.setRenderState(ts);		AlphaState as1= game.getDisplaySystem().getRenderer().getAlphaState();		as1.setBlendEnabled(true);		as1.setSrcFunction(AlphaState.SB_SRC_ALPHA);		as1.setDstFunction(AlphaState.DB_ONE);		as1.setTestEnabled(true);		as1.setTestFunction(AlphaState.TF_GREATER);		text.setRenderState(as1);		soundRenderer= game.getSoundSystem();		backgroundMusic= new Entity("BACKGROUND");		soundRenderer.addSource(backgroundMusic);		soundRenderer.getPlayer(backgroundMusic).setPosition(soundPosition);		soundRenderer.getPlayer(backgroundMusic).setMaxDistance(30.0f);		soundLoader= new OnDemandSoundLoader(10);		soundLoader.start();		soundLoader.queueSound(backgroundMusic.getId(), "data/sound/0.mp3");		soundNode= new Node();		soundNode.attachChild(text);		status= Scene.LOADING_NEXT_SCENE;		System.out.println("LOADING Sound");		text.print("Position " + soundPosition);		text.setLocalTranslation(new Vector3f(1, 60, 0));		Vector3f max= new Vector3f(5, 5, 5);		Vector3f min= new Vector3f(-5, -5, -5);		t= new Box(min, max);		t.setModelBound(new BoundingSphere());		t.updateModelBound();		TextureState tst= game.getDisplaySystem().getRenderer().getTextureState();		tst.setEnabled(true);		tst.setTexture(			TextureManager.loadTexture("data/Images/Monkey.jpg", Texture.MM_LINEAR, Texture.FM_LINEAR, true));		soundNode.setRenderState(tst);		ZBufferState buf= game.getDisplaySystem().getRenderer().getZBufferState();		buf.setEnabled(true);		buf.setFunction(ZBufferState.CF_LEQUAL);		soundNode.setRenderState(buf);		soundNode.attachChild(t);		//game.getCamera().update();		soundNode.updateGeometricState(0.0f, true);	}