2012-09-05 3 views
0

andEngine을 사용하여 게임을 개발 중입니다. 이 게임에 배경 사운드를 추가하고 싶습니다. 사운드 구현을 시도했지만 사운드가 재생되지 않습니다. pls 날 도와.andEngine의 사운드 문제

onLoadEngine()

return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, 
       new FillResolutionPolicy(), this.mCamera).setNeedsSound(true)) 

onLoadResources()는 onCreateScene() 방법

Sound bgSound; 
SoundFactory.setAssetBasePath("gfx/"); 
this.bgSound = SoundFactory.createSoundFromAsset(this.mEngine.getSoundManager(), this,    "bg.mid"); 
bgSound.setLoopCount(-1); 
bgSound.play(); 
+0

사운드 파일이 assets/gfx 폴더에 있습니까? – IncrediApp

+0

예 .it는 assets/gfx 폴더에 있습니다. – Andy

+0

setloopcount를 움직여서 onCreateScene 호출을 재생합니다. – IncrediApp

답변

1

이동이 2 개 라인 : 여기 내 코드 또한

bgSound.setLoopCount(-1); 
bgSound.play(); 

대신 SoundFactory.createMusicFromAsset 전화 SoundFactory.createSoundFromAsset