Using Wave Shield as Part of Group Project

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Predinchuk
 
Posts: 1
Joined: Tue Nov 15, 2011 6:12 pm

Using Wave Shield as Part of Group Project

Post by Predinchuk »

How can I set up my wave shield to play specific sounds off of my SD card by simply calling up each sound file as a function? I had a voice shield from spikenzie labs and the code for that was simple;

Code: Select all

#include <VoiceShield.h> // includes the library necessary to use the voice shield

VoiceShield vs(80); // creates an instance of the voiceshield class with the name vs divided into 80 sound bytes *note* 240s are available, so the sound bytes are (240s/80) = 3s each.

void setup() // The program wouldn’t compile without a void setup…so here’s my empty void setup….

{

}

void loop(){ // The loop that tests all of my sounds. I’ve left the clips that refused to work here as vestigial functions. Oh well.

  ahahaha();

  //preparing(); //doesn’t work (playings the next clip as well)

  dispensing();

  goodbye();

  hello();

  hello2();

  //hellofriend(); //doesn’t work (plays the next clip as well)

  isanyonethere();

  //iseeyou(); // doesn’t work (just won’t play)

  pleaseputmedown();

  putmedown();

  pleasestop();

  thereyouare();

  unknownerror();

  whoa();

  shuttingdown();

}

// All of the void functions that I can call to get certain sounds to play.

void ahahaha (){

vs.ISDPLAY_to_EOM(0);

}

void preparing (){

vs.ISDPLAY_to_EOM(1);

}

void dispensing (){

vs.ISDPLAY_to_EOM(2);

}

void goodbye (){

vs.ISDPLAY_to_EOM(3);

}

void hello (){

vs.ISDPLAY_to_EOM(4);

}

void hello2 (){

vs.ISDPLAY_to_EOM(5);

}

void hellofriend (){

vs.ISDPLAY_to_EOM(6);

}

void isanyonethere (){

vs.ISDPLAY_to_EOM(7);

}

void iseeyou (){

vs.ISDPLAY_to_EOM(8);

}

void pleaseputmedown (){

vs.ISDPLAY_to_EOM(9);

}

void putmedown (){

vs.ISDPLAY_to_EOM(10);

}

void pleasestop (){

vs.ISDPLAY_to_EOM(11);

}

void thereyouare (){

vs.ISDPLAY_to_EOM(12);

}

void unknownerror (){

vs.ISDPLAY_to_EOM(13);

}

void whoa (){

vs.ISDPLAY_to_EOM(14);

}

void shuttingdown (){

vs.ISDPLAY_to_EOM(15);

}

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Using Wave Shield as Part of Group Project

Post by adafruit_support_bill »

Check out the example programs here: http://www.ladyada.net/make/waveshield/examples.html

To play a file called "Hello" you would write:

Code: Select all

 playcomplete("Hello.WAV");

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”