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

Thread: Running Audio Library at 120Mhz

  1. #1
    Senior Member
    Join Date
    Feb 2015
    Posts
    160

    Running Audio Library at 120Mhz

    Hello!

    I am curious if anyone has had success running the Audio Library at 120 Mhz?

    Specifically I am trying to get AudioAnalyzeNoteFrequency to work with AudioInputAnalog (no Audio shield, just analog input pins). My sketch runs fine at 96Mhz and 144Mhz, but notefreq and peak don't return anything when its running at 120Mhz.

    Here is my sketch (just a modified version of the NoteFrequency example)
    Code:
    #include <Wire.h>
    #include <Audio.h>
    #include <analyze_notefreq.h>
    
    // GUItool: begin automatically generated code
    AudioInputAnalog         adc1(A9);           //xy=401.2000274658203,269.20001220703125
    AudioAnalyzePeak         peak1;        
    AudioAnalyzeNoteFrequency notefreq;      //xy=894.2000274658203,440.2000274658203
    AudioConnection          patchCord1(adc1, notefreq);
    AudioConnection          patchCord2(adc1, peak1);
    // GUItool: end automatically generated code
    
    void setup(){
      delay(10);
      AudioMemory(50);
    
      Serial.begin(9600);
      delay(10);
      notefreq.begin(.15);
      Serial.println("sizeof adc1: " + String(sizeof(adc1)));
      Serial.println("sizeof notefreq: " + String(sizeof(notefreq)));
      Serial.println("sizeof patchCord1: " + String(sizeof(patchCord1)));
      pinMode(13, OUTPUT);
    
    }
    
    void loop(){
      delay(100);
      digitalWrite(13, HIGH);
      delay(100);
    
     if (notefreq.available()) {
       float note = notefreq.read();
       float prob = notefreq.probability();
       Serial.printf("Note: %3.2f | Probability: %.2f\n", note, prob);
       Serial.println(String(millis() )+ " -- " + String(AudioMemoryUsage()));
     } 
    
     if (peak1.available()){
       Serial.println("peaks1: " + String(peak1.read()));
      
     }
    
      digitalWrite(13, LOW);
    
    }

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,927
    AudioInputAnalog doesn't work at 72 MHz. It's a known bug.

    https://github.com/PaulStoffregen/Audio/issues/96

    Maybe it doesn't work at 120 MHz either?

  3. #3
    Senior Member
    Join Date
    Feb 2015
    Posts
    160
    Seems like it. Its hard to test AudioInputAnalog all on its own, but I can't it it to work with AudioAnalyzeFFT1024 either.

    I am digging up my audio shield and will test AudioAnalyzeFFT1024 at 120Mhz without AudioInputAnalog to verify that works, in which case I would be fairly confident that it doesn't work with 120Mhz as well.

  4. #4
    Senior Member
    Join Date
    Feb 2015
    Posts
    160
    Yep, AudioAnalyzeFFT1024 works fine at 120Mhz with I2S input. Must be AudioInputAnalog...

Posting Permissions

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