Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.