Skip to content

Solves issue of stalling audio playback after 5-8 .wav files #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions examples/SimpleAudioPlayerZero/SimpleAudioPlayerZero.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ void setup()
while(true);
}
Serial.println(" done.");

// 44100kHz stereo => 88200 sample rate
AudioZero.begin(2*44100);
}

void loop()
Expand All @@ -47,6 +44,8 @@ void loop()

// open wave file from sdcard
File myFile = SD.open("test.wav");
// 44100kHz stereo => 88200 sample rate
AudioZero.begin(2*44100);
if (!myFile) {
// if the file didn't open, print an error and stop
Serial.println("error opening test.wav");
Expand All @@ -57,7 +56,7 @@ void loop()

// until the file is not finished
AudioZero.play(myFile);

AudioZero.close();
Serial.println("End of file. Thank you for listening!");
while (true) ;
}