I’m developing a game using andEngine. I want to add a background sound for this game. I tried implementing sound,but sound is not getting played. pls help me out. Here is my code :
onLoadEngine()
return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE,
new FillResolutionPolicy(), this.mCamera).setNeedsSound(true))
onLoadResources()
Sound bgSound;
SoundFactory.setAssetBasePath("gfx/");
this.bgSound = SoundFactory.createSoundFromAsset(this.mEngine.getSoundManager(), this, "bg.mid");
bgSound.setLoopCount(-1);
bgSound.play();
Move these 2 lines to the
onCreateScene()method:Also, call
SoundFactory.createMusicFromAssetinstead ofSoundFactory.createSoundFromAsset