안드로이드 개발 질문/답변
(글 수 45,052)
SoundPool에 로드된 사운드를 순간적으로 많이 플레이를 할 경우
재생되지 않고 아래 로그를 띄우면서 그 다음부터는 소리가 안나더군요.
---------------------------------------------------------------------------------------------------
AudioTrack AudioFlinger could not create track, status: -12
SoundPool Error creating AudioTrack
AudioFlinger no more track names available
---------------------------------------------------------------------------------------------------
코드는 이렇습니다.
SoundPool sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
int s1 = sp.load(this, R.raw.a1, 1);
for(int i=0; i<100; i++)
{
sp.play(s1, 0.5f, 0.5f, 1, 0, 1);
}
혹시 해결하신 분 계신가요?




자료를 찾아보니 status -12가 not enough memory라는 것 같습니다.
실행전에 SoundPool.release() 를 통하여 메모리를 다 지우고 다시 실행하게 해보세요.