I am using USB Audio out from teensy 3.2 to PC USB port for playing or recording on the PC.
The Audio all plays with good sound except a low level click about 4 or 5 times per second ..... This is estimate from what I hear because I cannot see any glitches in the audio waveform when viewed in Audacity but I can still hear the clicks when I play it back. It is a low freq click and is easiest heard when playing a high freq sound. The sketch is playing a continuous 2000 Hz tone. I hear the clicks on the USB audio but not on the DAC Audio. The output wavform looks a perfect sine wave but must have some discontinuity somewhere.....any ideas how to isolate the problem??
The Audio all plays with good sound except a low level click about 4 or 5 times per second ..... This is estimate from what I hear because I cannot see any glitches in the audio waveform when viewed in Audacity but I can still hear the clicks when I play it back. It is a low freq click and is easiest heard when playing a high freq sound. The sketch is playing a continuous 2000 Hz tone. I hear the clicks on the USB audio but not on the DAC Audio. The output wavform looks a perfect sine wave but must have some discontinuity somewhere.....any ideas how to isolate the problem??
Code:
#include <Audio.h>
#include <Wire.h>
//#include <SPI.h>
//#include <SD.h>
//#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=244,163
AudioOutputUSB usb1; //xy=557,160
AudioConnection patchCord1(sine1, 0, usb1, 0);
AudioConnection patchCord2(sine1, 0, usb1, 1);
// GUItool: end automatically generated code
AudioOutputAnalog dac1;
AudioConnection patchCord3(sine1, 0, dac1, 0);
int freq = 2000;
void setup() {
// put your setup code here, to run once:
sine1.frequency(freq);
sine1.amplitude(0.4);
AudioMemory(80);
//delay(500);
}
void loop() {
// put your main code here, to run repeatedly:
//freq = freq + 100;
//sine1.frequency(freq);
//while(1);
//delay(500);
//if (freq >= 2000) freq = 100;
}