Pseudoabdul
New member
Hi,
I'm very new to teensy so this is probably a simple question but I'm still a bit stumped after searching the forums and tutorials.
I am trying to print out a real time amplitude value of the incoming microphone signal. I have modified the microphone test example to do this:
The only output it get is 1.0 with an occasional 0.0. This remains unchanged even if I unplug the microphone. The microphone seems to be fine as I can hear the signal.
I am using a Teensy 3.2 with the audio shield.
Thanks.
I'm very new to teensy so this is probably a simple question but I'm still a bit stumped after searching the forums and tutorials.
I am trying to print out a real time amplitude value of the incoming microphone signal. I have modified the microphone test example to do this:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=149,228
AudioAnalyzePeak peak1; //xy=407,266
AudioOutputI2S i2s2; //xy=447,200
AudioConnection patchCord1(i2s1, 0, i2s2, 0);
AudioConnection patchCord2(i2s1, 0, i2s2, 1);
AudioConnection patchCord3(i2s1, 0, peak1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=339,338
// GUItool: end automatically generated code
void setup() {
Serial.begin(9600);
AudioMemory(8);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
sgtl5000_1.micGain(36);
delay(1000);
}
void loop() {
Serial.println(peak1.read());
}
The only output it get is 1.0 with an occasional 0.0. This remains unchanged even if I unplug the microphone. The microphone seems to be fine as I can hear the signal.
I am using a Teensy 3.2 with the audio shield.
Thanks.