Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am developing a game using Andengine , I am using a Base Game Activity with multiple scenes. I want to load a background music in it.But I dont know how to enable sound in engine while using Base Game Activity.I found this code in net to enable sound .

return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, 
   new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera).setNeedsMusic(true));

But this one is written in onLoadScene() and I dont know how to impliment onLoadScene() in basegame actvity.Do I can override onLoadScene() in base game activity or is there any other ways to achive this please help me...

Any Suggestions are Valid to me and Advanced thanks to alll....

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Solved the issue with the Help of Jmr Here is the code

final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
    engineOptions.getAudioOptions().setNeedsSound(true);
    engineOptions.getAudioOptions().setNeedsMusic(true);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.