본문 바로가기

# Android

[Android] 효과음 넣기 - SoundPool

728x90
반응형
        SoundPool soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
        int soundPlay1 = soundPool.load(this, R.raw.sound1,1);
        int soundPlay2 = soundPool.load(this, R.raw.sound2,1);
        int soundPlay3 = soundPool.load(this, R.raw.sound3,1);
        int soundPlay4 = soundPool.load(this, R.raw.sound4,1);
        
                        soundPool.play(soundPlay1, 1f,1f,0,0,1f);
                        soundPool.play(soundPlay2, 1f,1f,0,0,1f);
                        soundPool.play(soundPlay3, 1f,1f,0,0,1f);
                        soundPool.play(soundPlay4, 1f,1f,0,0,1f);

 

728x90
반응형