play audio file using array


i play audio files in arduino using use of arrays. know error? wav files in same folder program. firstly, store file in array & call loop play. secondly, audio file play through speaker.

 below codes..

code: [select]
void setup() {
  // put setup code here, run once:

}

int speakerpin = 9;
int nooffiles = 2;
string filenames[] = {"one.wav", "two.wav"};
int sound=0;

void loop() {
  // put main code here, run repeatedly:
for (int i=0; i<nooffiles; i++)
{
    sound = (speakerpin, filenames[i]);
    delay(500);
}
}

what error ?

your arduino cannot access files computer.   you need have sd card attached arduino,   and read wav file(s) there.


Arduino Forum > Using Arduino > Programming Questions > play audio file using array


arduino

Comments