0
\$\begingroup\$

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

\$\endgroup\$
0
\$\begingroup\$

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);
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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