bricolodu13
Member
I'm trying to play SDfiles with a TDA1543 (similar to PT8211), but nothing happen.
I successfully tried the ListFiles Sketch, so I know that Teensy 3.5 can access the SDcard and sees the 4 files as per the following serial monitore message :
Initializing SD card...initialization done.
SYSTEM~1/
INDEXE~1 76
SDTEST1.WAV 16787550
SDTEST4.WAV 17173152
SDTEST3.WAV 13617358
SDTEST2.WAV 16425698
done!
However, when I try to play those Files, nothing work.
Here is what I have as a programm
The serial monitor never write anything and I get no sound from the DAC
Do you have any idea of what's missing ?
Thank you all
Jean
I successfully tried the ListFiles Sketch, so I know that Teensy 3.5 can access the SDcard and sees the 4 files as per the following serial monitore message :
Initializing SD card...initialization done.
SYSTEM~1/
INDEXE~1 76
SDTEST1.WAV 16787550
SDTEST4.WAV 17173152
SDTEST3.WAV 13617358
SDTEST2.WAV 16425698
done!
However, when I try to play those Files, nothing work.
Here is what I have as a programm
The serial monitor never write anything and I get no sound from the DAC
Code:
// Simple WAV file player example
// This example code is in the public domain.
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
File root;
AudioPlaySdWav playWav1;
AudioOutputPT8211 pt8211_1;
AudioConnection patchCord1(playWav1, 0, pt8211_1, 0);
AudioConnection patchCord2(playWav1, 1, pt8211_1, 1);
const int chipSelect = BUILTIN_SDCARD;
void setup() {
Serial.begin(9600);
AudioMemory(8);
Serial.print("Initializing SD card...");
if (!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
root = SD.open("/");
}
void playFile(const char *filename)
{
Serial.print("Playing file: ");
Serial.println(filename);
// Start playing the file. This sketch continues to
// run while the file plays.
playWav1.play(filename);
// A brief delay for the library read WAV info
delay(5);
// Simply wait for the file to finish playing.
while (playWav1.isPlaying()) {}
}
void loop() {
playFile("SDTEST1.WAV"); // filenames are always uppercase 8.3 format
delay(500);
playFile("SDTEST2.WAV");
delay(500);
playFile("SDTEST3.WAV");
delay(500);
playFile("SDTEST4.WAV");
delay(1500);
}
Do you have any idea of what's missing ?
Thank you all
Jean