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

Thread: AUDIO_INPUT_LINEIN Issues

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    11

    AUDIO_INPUT_LINEIN Issues

    Having a problem getting Line Inputs to work.

    iPhone>LineIn

    T3.1, building as USB Audio.

    Expecting to find a signal passed to the headphone jack.

    No output at all.

    Tried many examples, but this is an attempt to write a very simple sketch.

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    AudioOutputI2S           i2s1;     
    AudioControlSGTL5000     sgtl5000_1;
    
    void setup() {                
      AudioMemory(12); 
      sgtl5000_1.enable();
      sgtl5000_1.volume(5);
    
      sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
      sgtl5000_1.lineInLevel(5);
    }
    
    void loop() {
    }
    Seems there should be some routing code to patch the LI into other audio objects like the System Design Tool provides, but the method eludes me.

    What am I missing?

  2. #2
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Okay,

    progress!

    Found dap_bass_enhance.ino which had the answer. New simple sketch:

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
     
    
    AudioInputI2S       lineIn;         // audio shield: mic or line-in
    AudioOutputI2S      headphoneOut;        // audio shield: headphones & line-out
    
    // Create Audio connections between the components
    //
    AudioConnection c1(lineIn, 0, headphoneOut, 0); // left passing through
    AudioConnection c2(lineIn, 1, headphoneOut, 1); // right passing through
    
    AudioControlSGTL5000 Board;
    
    void setup() {                
      AudioMemory(12); 
      Board.enable();
      Board.volume(5);
    
      Board.inputSelect(AUDIO_INPUT_LINEIN);
      Board.lineInLevel(5);
    }
    
    void loop() {
    }

Posting Permissions

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