Refer to the site above to purchase an Arduino MKR Zero board,
There were too many parts needed, so I purchased the LM386 digital amplifier module and used it.
However, only the buzzer noise continues, and there is no playback.
Is it wrong to use the above module?
Manufacturer: YwRobot
Model Name: ELB060302
Site : (SKU:ELB060302)喇叭扬声器模块 功放音乐播放模块 - YwRobot Studio Wiki
I chose it because it was compatible with Arduino.
===========================my code==============================
#include <SD.h>
#include <SPI.h>
#include <AudioZero.h>
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// setup SD-card
Serial.print("Initializing SD card...");
if (!SD.begin()) {
Serial.println(" failed!");
while(true);
}
Serial.println(" done.");
}
void loop()
{
delay(1);
int count = 0;
// open wave file from sdcard
File myFile = SD.open("voice.wav");
if (!myFile) {
// if the file didn't open, print an error and stop
Serial.println("error opening voice.wav");
while (true);
}
Serial.print("Playing");
// until the file is not finished
AudioZero.begin(2*44100);
AudioZero.play(myFile);
Serial.println("End of file. Thank you for listening!");
while (true) ;
}
when logging
i see 'End of file. Thank you for listening'
===========================my circuit ==============================
my voice and noise sound file
voice&&noise.zip (504.9 KB)