0
我正在使用andEngine开发游戏。我想为此游戏添加背景音乐。我试着实现声音,但声音没有被播放。请帮助我。这是我的代码:andEngine中的声音问题
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();
您的声音文件是否位于assets/gfx文件夹中? – IncrediApp
yes..it在资产/ gfx文件夹中。 – Andy
移动setloopcount和播放调用onCreateScene – IncrediApp