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

Thread: Why is there no audio thru from mic -> usb in this simple sketch? (whitenoise works)

  1. #1

    Why is there no audio thru from mic -> usb in this simple sketch? (whitenoise works)

    Can someone spot why there is no audio from the mic to the USB out? (Whitenoise works well to the usb2 device).

    Teensy 3.6, Audio board.

    I know the mic works because other sketches let Audio thru from mic with no problem.
    I use VisualTeensy_V0.84 to compile the project. TyTools is used to transfer the target.
    This works fine on other projects ....

    I did try to compile the same sketch in the standard Arduino IDE. The same problem occurs there, so I doubt its the compiler / toolchain. There must be something I do wrong in the sketch ...




    Code:
    #include "Arduino.h"
    
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>  
    #include <SerialFlash.h>
    
    
    AudioControlSGTL5000     sgtl5000_1;     
    AudioInputI2S            i2s0;                            // INPUT from sgt15000_1 
    AudioOutputI2S           i2s1;                            //  OUTPUT analog - headset minijack
    
    AudioOutputUSB           usb2;     
    
    AudioSynthNoiseWhite      whitenoise;
    
    AudioConnection          PatchCord0 (i2s0,0, usb2,1); // audio thru test
    AudioConnection          PatchCord1 (whitenoise,0, usb2,0); // audio thru test
    
    
    void setup()
    {
      pinMode(LED_BUILTIN,OUTPUT);
    
      delay(10);  AudioMemory(25);  delay(50);  
      
      Serial.begin(115200);
      delay (500);                                     // Let the pc start up 
      Serial.print("setup() entered");
    
      // Enable the audio shield and set the output volume.
      sgtl5000_1.enable();
      delay(100);
      sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);        // Analog mic element on audio shield
      sgtl5000_1.micGain(25);
      sgtl5000_1.volume(0.2);                         //headphone volume
      whitenoise.amplitude(0.5);
    
    
    }
    
    void loop()
    {
      Serial.print("MEM:");Serial.println(AudioMemoryUsageMax() );
      delay(5000);
    }
    Last edited by Mike5000; 11-15-2018 at 09:16 AM.

Tags for this Thread

Posting Permissions

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