covirtTech
Member
Hello! Source code is below. I'm using Teensy4.0 with Audio Shield REVD. Like the title says, when the const int numLED is higher than 0, it breaks the audio connection (meaning the audio device shows up but no sound plays). When it's 0, the audio connection works fine. Any help here would be appreciated. Thanks!
Code:
//Begin audio + general libraries/vars
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioInputUSB usbInput; //xy=200,69 (must set Tools > USB Type to Audio)
AudioAnalyzeRMS rmsL;
AudioAnalyzeRMS rmsR;
AudioOutputI2S audioOutput; //xy=365,94
AudioConnection rms_L_Connection(usbInput, 0, rmsL, 0);
AudioConnection rms_R_Connection(usbInput, 1, rmsR, 0);
AudioConnection leftLineout(usbInput, 0, audioOutput, 0);
AudioConnection rightLineout(usbInput, 1, audioOutput, 1);
AudioControlSGTL5000 audioShield; //xy=302,184
//Begin LED libraries/vars
#include <OctoWS2811.h>
const int numLED = 0;
const int ledPin = 2;
const int bytesPerLED = 3; // change to 4 if using RGBW
DMAMEM int displayMemory[numLED * bytesPerLED];
int drawingMemory[numLED * bytesPerLED];
const int config = WS2811_RGB | WS2811_800kHz;
OctoWS2811 leds(numLED, displayMemory, drawingMemory, config);
void setup() {
//begin audio setup
AudioMemory(12); //audio shield memory (2.8ms per block)
audioShield.enable();
audioShield.volume(0.4);
// Serial.begin(9600);
//begin LED setup
pinMode(ledPin, OUTPUT);
leds.begin();
leds.show();
}
void loop() {
}
Last edited: