여러장의 이미지를
flipper와 애니메이션을 이용하여 구현 하였습니다
이미지마다 효과음을 내고 싶은데 어떻게 해야할지 몰라서요..
처음에는 무식하게 이미지마다 액티비티를 만들어 클릭할때 soundpool로 각각 소리를 지정해 줬는데
이건 아닌것 같아서요
도움을 요청합니다
SoundPool sound;
int[] _sound=new int[2];
sound=new SoundPool(3,AudioManager.STREAM_MUSIC,0);
_sound[0]=sound.load(getApplicationContext(),R.raw.sound1,1);
_sound[1]=sound.load(getApplicationContext(),R.raw.sound2,1);
.
이후에 사운드 출력할 일이 있을 때
sound.play(_sound[0], 1,1,0,0,1);
sound.play(_sound[1], 1,1,0,0,1);
저는 이런 식으로 쓰고 있습니다..
로그인 유지
SoundPool sound;
int[] _sound=new int[2];
sound=new SoundPool(3,AudioManager.STREAM_MUSIC,0);
_sound[0]=sound.load(getApplicationContext(),R.raw.sound1,1);
_sound[1]=sound.load(getApplicationContext(),R.raw.sound2,1);
.
.
이후에 사운드 출력할 일이 있을 때
sound.play(_sound[0], 1,1,0,0,1);
sound.play(_sound[1], 1,1,0,0,1);
저는 이런 식으로 쓰고 있습니다..