Answer the question
In order to leave comments, you need to log in
How to manage a lot of sounds in an android application?
I am learning android, and as a practice I am writing a small quiz program. In general, it is required, depending on the guessed thing, to reproduce a certain sound. In the last application where there were a few sounds 2-5pcs. just using the SoundPool was enough for me, now I need to play a certain sound (depending on the guessed object), there are about 40 of these sounds in total.
Help me figure out how to organize this without an endless loop if the object is like this - sound 1 if the object is like this - sound 2 if .... ? Thanks
Answer the question
In order to leave comments, you need to log in
You can do it like this:
int playSoundWithIdObject(int idObject){
switch(idObject){
case 0:
playSound();
break;
case 1:
playSound();
break;
case n:
playSound();
break;
default;
break;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question