• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Play random sound from big list

pikaachi

Lurker
In my res/raw folder, I have many .wav files. I want my program to choose a random sound clip from my res/raw folder and play it when I click a button.

I know a way to do it by hard coding the .wav IDs, auto-generated in the R class. But I just have too many .wav files to manually type each ID :(

I spent hours researching about this but I have no idea. Any help will be appreciated. Thanks!

EDIT: The .wav files do not have to be in the res/raw folder. I can move it inside assets folder if it makes things easier...
 
from my testing , .wav files didn't work on my phone
use mp3 or ogg (ogg is better)

I know this is not your question here, but thought I'd mention it :D
 
Back
Top Bottom