Someone on the forum wanted to know how to play a random file on the Wave Shield. Here's my solution. First, you need to make sure you have the helpful MediaPlayer class: http://www.arduino.cc/cgi-bin/yabb2/YaB ... 33246215#2. This really simplifies using the shield, now for the code:
int numSongs=mediaPlayer.exploreSDcard();
randNumber = random(numSongs);
playComplete(randNumber);
You may also want to use randomSeed() function in the setup() function as described here: http://arduino.cc/en/Reference/Random
Playing random file from Wave Shield
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
Please be positive and constructive with your questions and comments.