그래서 사운드 풀을 사용하여 타이머가 끝날 때 소리를 재생하고 있습니다. 에서 onCreate 내가 준비하지soundpool 및 setOnLoadCompleteListener를 사용하는 경우
샘플 0을 얻고 있었다이
int mySoundId; SoundPool soundPool; // load sound soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); AssetManager am = this.getAssets(); //Use in whatever method is used to load the sounds try { mySoundId = soundPool.load(am.openFd("alarm.wav"), 1); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
를하고있는 중이 야
그래서 나는
soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool soundPool, int mySoundId, int status) {
loaded = true;
}
});
을 사용했다 알아 냈하지만 내 문제는 , setOnLoadCompleteListener가 다음 오류를 표시합니다.
유형 SoundPool의 방법 setOnLoadCompleteListener (SoundPool.OnLoadCompleteListener) 가 인수 적용되지 않습니다(새 OnLoadCompleteListener() {}) I는 "안드로이드 도구로, 다양한 things을 시도
-> 프로젝트 속성 수정 "및"속성 -> Java 컴파일러 "로 만만치 않지만 기쁨은 없습니다. 내 API 범위는 10 - 16이므로 확인해야합니다. 어떤 아이디어와 함께 문제가 있습니까?
흥미, 사람이 단순한를 upvoted 내가 그것을 게시 한 후 몇 초! couldnt는 그것을 읽을 시간이 있었느냐? – Horse