Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Adding AudioInputAnalog breask the project

  1. #1
    Junior Member
    Join Date
    Nov 2019

    Adding AudioInputAnalog breaks the project

    I'm a beginner with Teensy, so I've spent the night setting up a simple mic and analog input that I want to do FFT. I've tried all samples I can find that uses AudioInputAnalog, but it just won't compile if I select Teensy 4.0 as a board. If I select any other Teensy board it will, but then it won't upload to the Teensy (which, of course, is understandable).

    Is it me or something else?

    Here's what I'm trying to do:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    // GUItool: begin automatically generated code
    AudioInputAnalog         adc1;           //xy=122,68
    AudioAmplifier           amp1;           //xy=279,126
    AudioAnalyzeFFT1024      fft1024;      //xy=433,180
    AudioConnection          patchCord1(adc1, amp1);
    AudioConnection          patchCord2(amp1, fft1024);
    // GUItool: end automatically generated code
    //AudioInputAnalog adc1(A0);
    float level[16];
    void setup() {
    void loop() {
      if (fft1024.available()) {
        // read the 512 FFT frequencies into 16 levels
        // music is heard in octaves, but the FFT data
        // is linear, so for the higher octaves, read
        // many FFT bins together.
        level[0] =;
        level[1] =;
        level[2] =, 3);
        level[3] =, 6);
        level[4] =, 10);
        level[5] =, 15);
        level[6] =, 22);
        level[7] =, 32);
        level[8] =, 46);
        level[9] =, 66);
        level[10] =, 93);
        level[11] =, 131);
        level[12] =, 184);
        level[13] =, 257);
        level[14] =, 359);
        level[15] =, 511);
        // See this conversation to change this to more or less than 16 log-scaled bands?
        for (int i = 0; i < 16; i++) {
          Serial.print(" ");
        Serial.print(" cpu:");
    Last edited by Moskus; 11-06-2019 at 08:59 PM.

  2. #2
    Same here.

  3. #3
    Junior Member
    Join Date
    Nov 2019
    ... anyone?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    AudioInputAnalog is not yet supported on Teensy 4.0.

    It will be at some point in the future, but with the missing USB types at a higher priority, it may be several weeks until this gets serious engineering time. I know that timeframe isn't great news, but hopefully an honest answer is better than not knowing?

  5. #5
    Junior Member
    Join Date
    Nov 2019
    I really appreciate your honesty, even if it wasn't the answer I was hoping for.

    It cost me another $20+ as I bought a Teensy 3.6 so I can continue codingwhile you hopefully fix the 4.0 compatibility issues... But I guess that's good new for you.
    It's not a problem, I'll live with it. And the good news is that I will be able to use the Teensy 4.0 sometime in the future.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts