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

Thread: Audio Library - "MonoPeakmeterAnalog" wont work on teensy3.1 without audioshield

  1. #1

    Audio Library - "MonoPeakmeterAnalog" wont work on teensy3.1 without audioshield

    Hi,
    Im starting to work with audio library, and I assumed that it also works without audioshield on a Teensy3.1
    But this example program, using only the onboard stuff, doesn't work ...
    I've got other sketches running with audio in and out, it works fine..
    Anyone?
    - I've checked analog signal chain with other sketches. ok.
    - I've patched input_adc.cpp to my rail to rail analog input circuitry. ok.
    //analogReference(INTERNAL); // range 0 to 1.2 volts <-- this is the audio library default, till now..
    analogReference(DEFAULT); // range 0 to 3.3 volts


    Code:
    /* Mono peak meter example using Analog objects. Assumes Teensy 3.1
    
    At a minimum DC decouple audio signals to/from Teensy pins with capacitors in the signal paths both in and out, 10uF is often used.
    Possibly worthwhile to set up virtual ground at 3v3/2 for both, or if changing DAC REF to 1.2V then 1.2V/2 for output side.
    
    This example code is in the public domain
    */
    
    #include <Audio.h>
    #include <Wire.h>
    #include <SD.h>
    
    const int myInput = AUDIO_INPUT_LINEIN;
    // const int myInput = AUDIO_INPUT_MIC;
    
    AudioInputAnalog        audioInput(A0);         // A0 is pin 14, feel free to change.
    AudioPeak               peak_M;
    AudioOutputAnalog       audioOutput;            // DAC pin.
    
    AudioConnection c1(audioInput,peak_M);
    AudioConnection c2(audioInput,audioOutput);
    
    void setup() {
      AudioMemory(4);
      Serial.begin(Serial.baud());
    }
    
    elapsedMillis fps;
    
    void loop() {
      if(fps>24) { // for best effect make your terminal/monitor a minimum of 31 chars wide and as high as you can.
        Serial.println();
        fps=0;
        uint8_t monoPeak=peak_M.Dpp()/2184.5321;
        Serial.print("|");
        for(uint8_t cnt=0;cnt<monoPeak;cnt++) Serial.print(">");
        peak_M.begin();
      }
    }

  2. #2
    Junior Member
    Join Date
    Aug 2014
    Posts
    7
    Quote Originally Posted by PaulD View Post
    Hi,
    Im starting to work with audio library, and I assumed that it also works without audioshield on a Teensy3.1

    Did you ever get this working?

    I'm having exactly the same problem!

Posting Permissions

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