녹음 된 파일을 재생할 때 soundpool을 사용하고 있습니다. 사운드 파크가 끝날 때를 알 수있는 방법이 있는지 알고 싶습니다. 여기에 내 작업 코드가 있습니다.soundpool에서 오디오 파일 재생이 끝났을 때를 아는 방법?
public void soundPool() {
final float playbackSpeed = 1.5f;
final SoundPool soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC,
100);
final int soundId = soundPool.load(audiofile.getAbsolutePath(), 1);
AudioManager mgr = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
final float volume = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool arg0, int arg1, int arg2) {
soundPool.play(soundId, volume, volume, 1, 0, playbackSpeed);
}
});
}