#include <Audio.h>
// WAV files converted to code by wav2sketch
#include "AudioSampleSnare.h" // http://www.freesound.org/people/KEVOY/sounds/82583/
// Create the Audio components. These should be created in the
// order data flows, inputs/sources -> processing -> outputs
//
AudioPlayMemory sound0;
AudioOutputAnalog dac; // play to both I2S audio board and on-chip DAC
// Create Audio connections between the components
//
AudioConnection c1(sound0, 0, dac, 0);
void setup() {
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(10);
}
void loop() {
// Snare plays continuously while the pin is touched.
while(touchRead(1) < 2000);
sound0.play(AudioSampleSnare);
delay(100); //change the delay ms to suit
}