#Blog5

Hello Everyone!

 

Happy Independence Day

Its August 15, we celebrate Independence Day in our country.

 

Here is my work on integrating SD Card Shield and PAM8403 Audio Amplifier to Arduino MKR1000. Which is the part of  "Smart Voice Synthesizer, Visualizer".

As per the design, the hand Gestures will be transformed into voice where this implementation play the key role. 

Components Required

  • Arduino MKR1000
  • Arduino UNO shield
  • Arduino MKR1000 SD Card Shield
  • PAM8403 Audio Amplifier Module
  • Jumper Wire
  • Speaker
  • SD Card

 

The Circuit

Connect the SD card shield to connect Arduino MKR1000 and Audio Amplifier

SD Card should contain test.wave audio file.

 

Arduino MKR1000 Audio

Demo

Independence Day special

“ Saare Jahanse Accha…….

The Code

 

#include <SD.h>
#include <SPI.h>
#include <AudioZero.h>


void setup()
{
  // debug output at 115200 baud
  Serial.begin(115200);


  // setup SD-card
  Serial.print("Initializing SD card...");
  if (!SD.begin(4)) {
    Serial.println(" failed!");
    while(true);
  }
  Serial.println(" done.");


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


void loop()
{
  int count = 0;


  // open wave file from sdcard
  File myFile = SD.open("test.wav");
  if (!myFile) {
    // if the file didn't open, print an error and stop
    Serial.println("error opening test.wav");
    while (true);
  }


  Serial.print("Playing");
  
  // until the file is not finished  
  AudioZero.play(myFile);


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




 

 

Stay Tuned

 

Thank You!