Really Simple Project Not Working

Status
Not open for further replies.

gfvalvo

Well-known member
Hi all.
The thing I'm trying to do is so stone cold simple, yet it's not working. I'm just trying to play an audio sample out of Pin A14 / DAC on a Teensy 3.2 to a set of ear buds. But no sound is coming out. I've either done something embarrassingly stupid, or this ADC output is not capable of driving earbuds. Please see below the Audio Design Tool setup, the electrical schematic, the code and a picture. Would appreciate someone letting me know where I screwed up.
Thanks.
Audio 2.jpgAudio.jpg

Code:
// WAV files converted to code by wav2sketch
#include "AudioSampleSnare.h"        // http://www.freesound.org/people/KEVOY/sounds/82583/
#include "AudioSampleTomtom.h"       // http://www.freesound.org/people/zgump/sounds/86334/
#include "AudioSampleHihat.h"        // http://www.freesound.org/people/mhc/sounds/102790/
#include "AudioSampleKick.h"         // http://www.freesound.org/people/DWSD/sounds/171104/
#include "AudioSampleGong.h"         // http://www.freesound.org/people/juskiddink/sounds/86773/
#include "AudioSampleCashregister.h" // http://www.freesound.org/people/kiddpark/sounds/201159/

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioPlayMemory          playMem1;       //xy=516,316
AudioOutputAnalog        dac1;           //xy=745,319
AudioConnection          patchCord1(playMem1, dac1);
// GUItool: end automatically generated code

void setup() {
  dac1.analogReference(INTERNAL);
}

uint32_t count = 0;
void loop() {
  Serial.print(count++);
  Serial.println(":  Playing AudioSampleSnare");
  playMem1.play(AudioSampleSnare);
  delay(1000);
}
 
And the answer is .......... I forgot to allocate AudioMemory!!!
Knew is was something dumb.
BTW, A14/DAC seems drive a pair of earbuds just fine.
 
Status
Not open for further replies.
Back
Top