snusmumriken
Active member
Please can someone help with this? I have searched this forum and the web, but find very little about using the Teensy audio capability with speakers.
I've got my Teensy 3.2 + audio board happily playing the SDTEST.WAV files, or my own .WAV file, from the SD card, and I can listen via the headphone jack.
However, I can't seem to persuade it to output anything to my amp via the DAC output. There is some hiss from the speaker, but no signal.
Hardware:
Teensy 3.2
Audio board
Adafruit PAM8302A
8ohm Visaton speaker (what I happened to have)
I have connected A+ on the amp to A14/DAC, and A- to GND.
I am powering both from 4AA LiFe batteries via a Polulu step-down 5V regulator.
GND is common throughout.
Code:
I've got my Teensy 3.2 + audio board happily playing the SDTEST.WAV files, or my own .WAV file, from the SD card, and I can listen via the headphone jack.
However, I can't seem to persuade it to output anything to my amp via the DAC output. There is some hiss from the speaker, but no signal.
Hardware:
Teensy 3.2
Audio board
Adafruit PAM8302A
8ohm Visaton speaker (what I happened to have)
I have connected A+ on the amp to A14/DAC, and A- to GND.
I am powering both from 4AA LiFe batteries via a Polulu step-down 5V regulator.
GND is common throughout.
Code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySdWav playWav1;
AudioOutputAnalog dac1;
AudioConnection patchCord1(playWav1, 0, dac1, 0);
AudioControlSGTL5000 sgtl5000_1;
#define SDCARD_CS_PIN 10
#define SDCARD_MOSI_PIN 7
#define SDCARD_SCK_PIN 14
void setup() {
Serial.begin(9600);
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(0.4);
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);
}
}
}
void playFile(const char *filename)
{
// Serial.print("Playing file: ");
// Serial.println(filename);
playWav1.play(filename);
// A brief delay for the library read WAV info
delay(5);
while (playWav1.isPlaying()) {
}
}
void loop() {
playFile("LAPWING.WAV");
while(true);
}