Simple audio player

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 ==============================
500px-扬声器LINE

my voice and noise sound file
voice&&noise.zip (504.9 KB)

Hello leejunhyeong1218
Post your current sketch, well formated, with comments and in so called code tags "</>" and a schematic, not a Fritzy diagram, to see how we can help.

Have a nice day and enjoy coding in C++.
Дайте миру шанс

I edited

What "buzzer noise"?
What is in your "voice.wav" file?

Desktop.zip (504.9 KB)

Noone will unzip an unknown file.

What does mean ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.