diff --git a/examples/SimpleAudioPlayer/SimpleAudioPlayer.ino b/examples/SimpleAudioPlayer/SimpleAudioPlayer.ino index 9c7647b..031aee6 100644 --- a/examples/SimpleAudioPlayer/SimpleAudioPlayer.ino +++ b/examples/SimpleAudioPlayer/SimpleAudioPlayer.ino @@ -38,7 +38,6 @@ void setup() { // 44100kHz stereo => 88200 sample rate // 100 mSec of prebuffering. - Audio.begin(88200, 100); } void loop() { @@ -46,6 +45,7 @@ void loop() { // open wave file from sdcard File myFile = SD.open("test.wav"); + Audio.begin(88200, 100); if (!myFile) { // if the file didn't open, print an error and stop Serial.println("error opening test.wav"); @@ -75,8 +75,7 @@ void loop() { } } myFile.close(); - + Audio.close(); Serial.println("End of file. Thank you for listening!"); while (true) ; } -