AUDIO_INPUT_LINEIN Issues

Status
Not open for further replies.

jmercer

Member
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?
 
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() {
}
 
Status
Not open for further replies.
Back
Top