I'm using the following sketch to try and pinpoint why I can't play a clip from the serial flash on the audio board. I suspect I'm just missing something in my sketch and could use a little help. I've converted a WAV to the raw format using Audacity as outlined in other posts and transferred from an SD card to the serial flash. Here's the name of the audio file followed by the sketch. Thanks for any help!
All Files on SPI Flash chip:
SNARE1~1.AIF 24258 bytes
All Files on SPI Flash chip:
SNARE1~1.AIF 24258 bytes
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioPlaySerialflashRaw playFlashRaw1; //xy=145,62
AudioPlaySerialflashRaw playFlashRaw2; //xy=161,115
AudioMixer4 mixer1; //xy=390,210
AudioOutputI2S i2s1; //xy=740,251
AudioConnection patchCord1(playFlashRaw1, 0, mixer1, 0);
AudioConnection patchCord2(playFlashRaw2, 0, mixer1, 1);
AudioConnection patchCord3(mixer1, 0, i2s1, 0);
AudioConnection patchCord4(mixer1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=583,416
// GUItool: end automatically generated code
void setup() {
AudioMemory(10);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
mixer1.gain(0, 0.4);
mixer1.gain(1, 0.4);
}
void loop() {
playFlashRaw1.play("SNARE1~1.AIF");
delay(2000);
}