2014년 12월 10일 수요일

choosing random sounds


I'm doing music app on mit app inventor 2 and I have a problem. I want my application to play random sounds from a list of sounds. I've put to app inventor 9 different sounds and after clicking proper button I want my application to play 4 random sounds from this 9 (sounds can repeat). Could you help me with doing this?

--
use the pick a random item block


pick a random item
Picks an item at random from the list.

--
It still doesn't solve my problem. I want my app to pick 4 random items from 9 I've placed in my app, not 1 item. Do you know how to do this ? 

--
what have you tried? 
just pick another random item after the sound finished playing
you might want to use the Player component instead of the Sound component
and if you need to play exactly 4 sounds, use additionally a counter variable to count up to 4, if counter = 4 then stop else pick another random item and play it


It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

댓글 2개: