Sound Pool Yuklanuvchi tinglovchisi?

Soundpool-ga ovozni qo'yaman va keyin:

mySoundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
        public void onLoadComplete(SoundPool soundPool, int sampleId,
                int status) {
            loaded = true;
        }
    });

Mening savolim quyidagilardan iboratki, ovozni to'g'ridan to'g'ri yuklab olishdan keyin qanday qilib tugmachani tegmoqchi bo'lgan foydalanuvchi qilmasdan turib o'ynashi mumkin?

Rahmat

1
onLoadComplete (...) usulida mySoundPool.play (...) ga qo'ng'iroq qiling.
qo'shib qo'ydi muallif Squonk, manba

1 javoblar

SoundPool.setOnLoadCompleteListner(new OnLoadCompleteListner(){

@override
onLoadComplete(SoundPool soundPool, int sampleId, int status)
{
    if(status == 0)
    soundPool.play(soundId, 1.0f, 1.0f, 0, 0, 0.0f);
}});
1
qo'shib qo'ydi