USB Audio Input Not Working

Status
Not open for further replies.

neroroxxx

Well-known member
Hi all, I started messing around with the Audio library again, I'm messing around with USB Audio, basically i just want to check if my T3.6 is reading audio from the USB port, however it doesn't seem to be so im sure i'm missing something.

It's a Teensy 3.6 with USB Type set to Audio, i took the mono peak meter example sketch and changed the adc1 to be AudioInputUSB (based on the GUI designer), i also added some a few Serial lines to see if it's reading anything, So far i "Launched" printed on the monitor but nothing else. Am I missing something here?? My Mac recognizes the Teensy and shows up as and output, i'm playing music from iTunes.

If i uncomment the "tick" line it will show up on the monitor as expected, however if i only uncomment the "tock" line it will not print it even with audio playing from my computer

Here's my sketch

Code:
/* Mono Peak Meter

   Scrolling peak audio level meter in the Arduino Serial Monitor

   Audio input needs to connect to pin 16 (A2).  The signal range is 0 to 1.2V.
   See the documentation in the Audio System Design Tool for the recommended
   circuit to connect an analog signal.

   This example code is in the public domain
*/

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputUSB            input;           //xy=164,95
AudioAnalyzePeak         peak1;          //xy=317,123
AudioConnection          patchCord1(input, peak1);
// GUItool: end automatically generated code


void setup() {
  Serial.begin(115200);
  Serial.println("Launched");
  AudioMemory(4);
}

// for best effect make your terminal/monitor a minimum of 31 chars wide and as high as you can.

elapsedMillis fps;

void loop() {
  if(fps > 24){
    //Serial.println("tick");
    if(peak1.available()){
      //Serial.println("tock");
      fps = 0;
      int monoPeak = peak1.read() * 30.0;
      Serial.print("|");
      for(int cnt = 0; cnt < monoPeak; cnt++){
        Serial.print(">");
      }
      Serial.println("");
    }
  }
}
 
Last edited:
Apparently, you didn’t read the full documentation of the AudioInputUSB object in the right sidebar of the audio design tool:
USB input & output does not cause the Teensy Audio Library to update. At least one non-USB input or output object must be present for the entire library to update properly.


 
Status
Not open for further replies.
Back
Top