No USB Audio Output

Status
Not open for further replies.

ccostes

New member
Hi All, I'm trying to get started with using a Teensy 4.1 as a USB audio input on Mac and haven't been able to get any output. I see 'Teensy Audio' as an input device, but recording with Audacity shows no signal.

Tried with the `WavFilePlayerUSB` example, as well as this simple example to output a sine wave. Any suggestions of what to try?

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

AudioSynthWaveformSine   sine1;
AudioOutputAnalog        dac1;
AudioOutputUSB           usb1;
AudioConnection          patchCord1(sine1, 0, usb1, 0);
AudioConnection          patchCord2(sine1, 0, usb1, 1);

void setup() {
  AudioMemory(15);
  sine1.amplitude(1.0);
  sine1.frequency(500);
}

void loop() {
}
 
Oh perfect, adding an AudioOutputI2S worked for both the simple sine script as well as the WavFilePlayerUSB example, thanks!

Wonder why the WavFilePlayerUSB example doesn't have that in there if it's apparently required.

Working test script for posterity:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

AudioOutputI2S           i2s1;
AudioSynthWaveformSine   sine1;
AudioOutputAnalog        dac1;
AudioOutputUSB           usb1;
AudioConnection          patchCord1(sine1, 0, usb1, 0);
AudioConnection          patchCord2(sine1, 0, usb1, 1);

void setup() {
  AudioMemory(15);
  sine1.amplitude(0.2);
  sine1.frequency(500);
}

void loop() {
}
 
Status
Not open for further replies.
Back
Top