I've soldered a new audio board directly to a new Teensy 3.5 in the recommended layout. I have tested all the connections with the pins to make sure that they are solid.
I am trying to run the WavFilePlayer example with an SD card in the Teensy 3.5. It loads and the onboard LED illuminates, however my audio file that worked with a Teensy 3.2 and audio board does not play. Notably, the Serial port disappears as well (ie: port: [no device] (Teensy 3.5) Serial.) so it's difficult to trouble shoot.
Here is my code:
// Simple WAV file player example
//
// Three types of output may be used, by configuring the code below.
//
// 1: Digital I2S - Normally used with the audio shield:
// http://www.pjrc.com/store/teensy3_audio.html
//
// To configure the output type, first uncomment one of the three
// output objects. If not using the audio shield, comment out
// the sgtl5000_1 lines in setup(), so it does not wait forever
// trying to configure the SGTL5000 codec chip.
//
// The SD card may connect to different pins, depending on the
// hardware you are using. Uncomment or configure the SD card
// pins to match your hardware.
//
// Data files to put on your SD card can be downloaded here:
// http://www.pjrc.com/teensy/td_libs_AudioDataFiles.html
//
// This example code is in the public domain.
I tested this setup with the listfiles example in the SD examples and it successfully lists the files on the card. The Serial port does not disappear.
I tested this setup with the tonesweep example and it plays.
Sorry to bother you if it is a simple issue but I cannot google the solution so far.
Thanks so much for your assistance,
Erin
I am trying to run the WavFilePlayer example with an SD card in the Teensy 3.5. It loads and the onboard LED illuminates, however my audio file that worked with a Teensy 3.2 and audio board does not play. Notably, the Serial port disappears as well (ie: port: [no device] (Teensy 3.5) Serial.) so it's difficult to trouble shoot.
Here is my code:
// Simple WAV file player example
//
// Three types of output may be used, by configuring the code below.
//
// 1: Digital I2S - Normally used with the audio shield:
// http://www.pjrc.com/store/teensy3_audio.html
//
// To configure the output type, first uncomment one of the three
// output objects. If not using the audio shield, comment out
// the sgtl5000_1 lines in setup(), so it does not wait forever
// trying to configure the SGTL5000 codec chip.
//
// The SD card may connect to different pins, depending on the
// hardware you are using. Uncomment or configure the SD card
// pins to match your hardware.
//
// Data files to put on your SD card can be downloaded here:
// http://www.pjrc.com/teensy/td_libs_AudioDataFiles.html
//
// This example code is in the public domain.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySdWav playWav1;
// Use one of these 3 output types: Digital I2S, Digital S/PDIF, or Analog DAC
AudioOutputI2S audioOutput;
AudioConnection patchCord1(playWav1, 0, audioOutput, 0);
AudioConnection patchCord2(playWav1, 1, audioOutput, 1);
AudioControlSGTL5000 sgtl5000_1;
// Use these with the Teensy Audio Shield
//#define SDCARD_CS_PIN 10
//#define SDCARD_MOSI_PIN 7
//#define SDCARD_SCK_PIN 14
// Use these with the Teensy 3.5 & 3.6 SD card
#define SDCARD_CS_PIN BUILTIN_SDCARD
#define SDCARD_MOSI_PIN 11 // not actually used
#define SDCARD_SCK_PIN 13 // not actually used
void setup() {
Serial.begin(9600);
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(80); // I changed this to see if it helps, it didn't
// Comment these out if not using the audio adaptor board.
// This may wait forever if the SDA & SCL pins lack
// pullup resistors
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN))) {
// stop here, but print a message repetitively
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
}
void loop() {
if (!playWav1.isPlaying()) {
playWav1.play("TTS-20M.WAV");
delay(10);
Serial.println("it's playing.");
}
}
I tested this setup with the listfiles example in the SD examples and it successfully lists the files on the card. The Serial port does not disappear.
I tested this setup with the tonesweep example and it plays.
Sorry to bother you if it is a simple issue but I cannot google the solution so far.
Thanks so much for your assistance,
Erin
Last edited by a moderator: