AudioInputUSB - AudioAnalyzePeak

Status
Not open for further replies.

Stephan

New member
Hello Everyone

Here my very simple Test-Code (Board: Teensy 3.2):

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

// GUItool: begin automatically generated code
AudioInputUSB            usb1;           //xy=101,107
AudioAnalyzePeak         peak1;          //xy=308,101
AudioConnection          patchCord1(usb1, 0, peak1, 0);
// GUItool: end automatically generated code

void setup() {
  AudioMemory(10);
}

void loop() {
  if (peak1.available()) {
    Serial.println(peak1.read());
  }
}

"Peak1.available()" never retuns true, no matter if there is some signal (music) from USB or not.

If I only use "Serial.println(peak1.read())", I got some values when music is on. If there is no music or signal, it returns 1 (instead of 0).

Anyone knows the reason?

Thanks for help
Stephan
 
Status
Not open for further replies.
Back
Top