Hello everyone! I've got a Teensy 4.0 with an Audio Shield REV D all soldered together and working PERFECTLY for everything else - just can't play my tracks off the sd card
So everything was going great, I was thoroughly enjoying baby stepping along with Alex Glow as my tour guide, and i've been able to get pretty much everything to work functionally. I've got all the connections to produce the desired effect with all the PROVIDED audio files you guys made available (which are amazing by the way and kudos to the chef if one of them happens to be on 'the team').
However, I have as yet been unable to get any audio files I've put on the sd card to play in any kind of way. Sure the device is happy to tell me its playing them, I was able to get this far by changing the title of the files to an 8.3 format. I've tried everything i can think of, even converting to RAW headerless file types and attempting to play from MEM (all my files are tiny little samples I'll eventually want to simply loop, driven by hopefully one of the clocks on teensy so it would be amazing if i could play them like that though i don't expect to really was just trying it to see if i could get something to play).
Here is source code for playing one of the files (I think the sketch is the first music playing one in the tutorial) and the serial monitor just outputs 'Start Playing' over and over again to the delay that is set. No sound though, and if i play any of my files in the 'wavplayer' it'll actually say that it's 'playing DRUM120.WAV' or whichever just no sound until it plays one of YOUR files like SDTEST3.WAV and then it plays all the way through, then going to KEYS150.WAV, GUIT85.WAV, and so on and so forth with no sound whatsoever.
I assuming it's the format of the files but they are all 32-bit 44100Hz which is the same as the SDTEST.WAV files i've noticed so not sure why that wouldn't work. Ok i've included the source code and a pic. hope ya'll can help!
So everything was going great, I was thoroughly enjoying baby stepping along with Alex Glow as my tour guide, and i've been able to get pretty much everything to work functionally. I've got all the connections to produce the desired effect with all the PROVIDED audio files you guys made available (which are amazing by the way and kudos to the chef if one of them happens to be on 'the team').
However, I have as yet been unable to get any audio files I've put on the sd card to play in any kind of way. Sure the device is happy to tell me its playing them, I was able to get this far by changing the title of the files to an 8.3 format. I've tried everything i can think of, even converting to RAW headerless file types and attempting to play from MEM (all my files are tiny little samples I'll eventually want to simply loop, driven by hopefully one of the clocks on teensy so it would be amazing if i could play them like that though i don't expect to really was just trying it to see if i could get something to play).
Here is source code for playing one of the files (I think the sketch is the first music playing one in the tutorial) and the serial monitor just outputs 'Start Playing' over and over again to the delay that is set. No sound though, and if i play any of my files in the 'wavplayer' it'll actually say that it's 'playing DRUM120.WAV' or whichever just no sound until it plays one of YOUR files like SDTEST3.WAV and then it plays all the way through, then going to KEYS150.WAV, GUIT85.WAV, and so on and so forth with no sound whatsoever.
I assuming it's the format of the files but they are all 32-bit 44100Hz which is the same as the SDTEST.WAV files i've noticed so not sure why that wouldn't work. Ok i've included the source code and a pic. hope ya'll can help!
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySdWav playSdWav1;
AudioOutputI2S i2s1;
AudioConnection patchCord1(playSdWav1, 0, i2s1, 0);
AudioConnection patchCord2(playSdWav1, 1, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1;
// Use these with the Teensy Audio Shield
#define SDCARD_CS_PIN 10
#define SDCARD_MOSI_PIN 11
#define SDCARD_SCK_PIN 13
void setup() {
Serial.begin(9600);
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN))) {
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
delay(1000);
}
void loop() {
if (playSdWav1.isPlaying() == false) {
Serial.println("Start playing");
playSdWav1.play("DRUM80.WAV");
delay(10);
}
}
Last edited by a moderator: