Teensy 4.1 with audio shield questions

Status
Not open for further replies.
I am using the teensy 4.1 with the audio shield (made sure it was the correct one for this board) and I cannot get the input working properly. I am simply trying to have it write the rms of the input signal to the serial output but its reading 0.00 no matter what, I verified the audio signal is coming cleanly with a speaker so there is not issue there. Here is my wiring:

audiocircuit1.jpg

The code I am using is:

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

// GUItool: begin automatically generated code
AudioInputI2S SHIELD_INPUT; //xy=175,217.00000286102295
AudioAnalyzeRMS rms1; //xy=552.0000076293945,350.00000190734863
AudioConnection patchCord1(SHIELD_INPUT, 0, rms1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=378,446
// GUItool: end automatically generated code

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);

}

void loop() {
// put your main code here, to run repeatedly:
Serial.print(rms1.read());
Serial.print("\n");
}


I wired it based on the diagram for the 4.X audio shield on the product page. I am using the arduino 1.8.12 with the teensy add on as well as the audio system design tool (using i2s for the shield input directly to an RMS node).

Am I missing some steps? I am unsure how to verify if the audio shield is even working at all. Any help would be greatly appreciated, I am struggling to find answers.

Best wishes.
 
For starters, there needs to be a line in setup() to allocate memory for the Audio Library. Something like:

AudioMemory(12);

Try one of the examples, e.g. Pass Through Stereo, to see if the shield is working.

hope this helps
 
Status
Not open for further replies.
Back
Top