I can't seem to get the FFT example running with audio line in; it just spits out flat/empty output.
Hardware:
- Teensy 3.6
- Audio Shield (should be rev. C)
- TRRS jack for input (T to left, R1 to right, R2 to gnd)
Code changes:
The default FFT example, but with AUDIO_INPUT_LINEIN and the proper AudioConnection to wire the input to the FFT. Volume set to 0.9 instead of 0.5. Configuration looks as following:
Rest of the snippet is unchanged from FFT example (aside from volume 0.9).
Some troubleshooting:
- The output sounds fine (wired audioInput to audioOutput, headphones to the headphone jack); music piped through the teensy sounds clear and normal
- The FFT module works fine with the generated sinewave if I swap to it (commenting out line in, uncommenting out sinewave)
- Dropping some debug prints in the FFT code itself seems to indicate that it's not reading any meaningful data from line-in (i.e. dump the buffer and all the values are between negative hundreds and positive hundreds). When eyeballing the output with line-in set, I can't tell when the AUX is plugged/unplugged, but it's extremely clear with the generated sine wave when values spike to the thousands or ten thousands.
Not sure what obvious mistake I'm missing here, but everything seems to work in isolation.
Hardware:
- Teensy 3.6
- Audio Shield (should be rev. C)
- TRRS jack for input (T to left, R1 to right, R2 to gnd)
Code changes:
The default FFT example, but with AUDIO_INPUT_LINEIN and the proper AudioConnection to wire the input to the FFT. Volume set to 0.9 instead of 0.5. Configuration looks as following:
Code:
const int myInput = AUDIO_INPUT_LINEIN;
//const int myInput = AUDIO_INPUT_MIC;
// Create the Audio components. These should be created in the
// order data flows, inputs/sources -> processing -> outputs
//
AudioInputI2S audioInput; // audio shield: mic or line-in
AudioSynthWaveformSine sinewave;
AudioAnalyzeFFT1024 myFFT;
AudioOutputI2S audioOutput; // audio shield: headphones & line-out
// Connect either the live input or synthesized sine wave
AudioConnection patchCord1(audioInput, 0, myFFT, 0);
AudioConnection patchCord2(audioInput, 0, audioOutput, 0);
AudioConnection patchCord3(audioInput, 1, audioOutput, 1);
// AudioConnection patchCord1(sinewave, 0, myFFT, 0);
Rest of the snippet is unchanged from FFT example (aside from volume 0.9).
Some troubleshooting:
- The output sounds fine (wired audioInput to audioOutput, headphones to the headphone jack); music piped through the teensy sounds clear and normal
- The FFT module works fine with the generated sinewave if I swap to it (commenting out line in, uncommenting out sinewave)
- Dropping some debug prints in the FFT code itself seems to indicate that it's not reading any meaningful data from line-in (i.e. dump the buffer and all the values are between negative hundreds and positive hundreds). When eyeballing the output with line-in set, I can't tell when the AUX is plugged/unplugged, but it's extremely clear with the generated sine wave when values spike to the thousands or ten thousands.
Not sure what obvious mistake I'm missing here, but everything seems to work in isolation.