teensy4.1 and MAX98357 not working issue

paraco

New member
I play the test.wav file by connecting teensy4.1 and MAX98357 modules, but there is no sound. I don't know what the problem is. Experts, please guide me.


#include <Audio.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySdWav playWav1;
AudioOutputI2S2 audioOutput;
AudioConnection patchCord1(playWav1, 0, audioOutput, 0);
AudioConnection patchCord2(playWav1, 1, audioOutput, 1);

void setup() {
Serial.begin(115200);
AudioMemory(100);
if (!(SD.begin(BUILTIN_SDCARD))) {
Serial.println("SD card initialization failed!");
return;
}
}
void loop() {
if (Serial.available()) {
char c = Serial.read();
if (c == 'p') {
Serial.println("test.wav file play start");
playWav1.play("test.wav");
delay(10);

while (playWav1.isPlaying()) {
Serial.println("playing.....");
delay(100);
}
}
}
}
 

Attachments

  • 1710308318273.png
    1710308318273.png
    186.6 KB · Views: 42
  • teensy4.1-3.jpeg
    teensy4.1-3.jpeg
    274.5 KB · Views: 41
  • teensy4.1-2.jpeg
    teensy4.1-2.jpeg
    265.6 KB · Views: 40
  • teensy4.1-1.jpeg
    teensy4.1-1.jpeg
    308.5 KB · Views: 45

AudioPlaySdWav - Notes​

Only 16 bit PCM, 44100 Hz WAV files are supported.

test.wav is 16bit PCM, 8000 Hz WAV

I have found the cause.
 
Back
Top