I see others are able to use Audacity on a PC for recording audio from the Teensy/audio shield but it is not working for me. I can see the teensy as a USB audio device and select it for input and output in audacity but when either monitoring it or trying to record there is no audio signal present. I can go to youtube and play a video and hear it on the audio shields headphone connection. That works fine, but seems the audio does not get to the PC for recording. I also mixed in the microphone on the audio shield and that does not produce any audio to the PC either. Teensy is selected as my audio input recording device and playback device in windows audio settings. Audacity does work if I use stereomix as an input, but not the teensy if I try to record a YouTube video's audio.
I am using a teensy 3.2 and audio shield on a windows 10 laptop. Also, I have a octows2811 board hooked up to the teensy but it isn't being used yet.
I am using a teensy 3.2 and audio shield on a windows 10 laptop. Also, I have a octows2811 board hooked up to the teensy but it isn't being used yet.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s2; //xy=121,318
AudioInputUSB usb1; //xy=122,247
AudioMixer4 mixer2; //xy=271,331
AudioMixer4 mixer1; //xy=274,262
AudioOutputI2S i2s1; //xy=463,295
AudioConnection patchCord1(i2s2, 0, mixer1, 1);
AudioConnection patchCord2(i2s2, 1, mixer2, 1);
AudioConnection patchCord3(usb1, 0, mixer1, 0);
AudioConnection patchCord4(usb1, 1, mixer2, 0);
AudioConnection patchCord5(mixer2, 0, i2s1, 1);
AudioConnection patchCord6(mixer1, 0, i2s1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=273,457
// GUItool: end automatically generated code
void setup() {
AudioMemory(12);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
sgtl5000_1.micGain(35);
mixer1.gain(0, .8);
mixer1.gain(1, .8);
mixer2.gain(0, .8);
mixer2.gain(1, .8);
}
void loop() {
// read the PC's volume setting
float vol = usb1.volume();
// scale to a nice range (not too loud)
// and adjust the audio shield output volume
if (vol > 0) {
// scale 0 = 1.0 range to:
// 0.3 = almost silent
// 0.8 = really loud
vol = 0.3 + vol * 0.5;
}
// use the scaled volume setting. Delete this for fixed volume.
sgtl5000_1.volume(vol);
delay(1000);
}
Last edited: