#include <Audio.h>

#include <Wire.h>

#include <SPI.h>

#include <SD.h>

#include <SerialFlash.h>

// GUItool: begin automatically generated code

AudioControlCS42448 CS42448_Chip; //xy=334.99999237060547,42.000009536743164

AudioInputTDM TDMInput; //xy=300.00000381469727,344

AudioOutputTDM TDMOutput; //xy=1027.0834007263184,335.0556411743164

AudioAnalyzePeak Peak_Ch1L; //xy=679.0000076293945,60.0000057220459

AudioAnalyzePeak Peak_Ch1R; //xy=679,93.00000190734863

AudioAnalyzePeak Peak_Ch2L; //xy=679.0000076293945,127.00000190734863

AudioAnalyzePeak Peak_Ch2R; //xy=680.0000076293945,160.00000190734863

AudioAnalyzePeak Peak_Ch3L; //xy=679.0000076293945,194.00000286102295

AudioAnalyzePeak Peak_Ch3R; //xy=677.0000076293945,228.00000286102295

AudioAnalyzePeak Peak_Ch4L; //xy=678.0000076293945,264.00000381469727

AudioAnalyzePeak Peak_Ch4R; //xy=678.0000076293945,297.00000381469727

AudioAnalyzePeak Peak_Ch5L; //xy=679.0000076293945,332.0000047683716

AudioAnalyzePeak Peak_Ch5R; //xy=679.0000076293945,366.0000057220459

AudioAnalyzePeak Peak_Ch6R; //xy=679.0000076293945,434.0000057220459

AudioAnalyzePeak Peak_Ch8R; //xy=679.0000076293945,580.0000095367432

AudioAnalyzePeak Peak_Ch6L; //xy=680.0000076293945,400.0000057220459

AudioAnalyzePeak Peak_Ch7R; //xy=680.0000076293945,507.0000078678131

AudioAnalyzePeak Peak_Ch8L; //xy=680.0000076293945,544.0000085830688

AudioAnalyzePeak Peak_Ch7L; //xy=681.0000076293945,471.00000762939453

AudioConnection patchCord1(TDMInput, 0, Peak_Ch1L, 0);

AudioConnection patchCord2(TDMInput, 0, TDMOutput, 0);

AudioConnection patchCord3(TDMInput, 1, Peak_Ch1R, 0);

AudioConnection patchCord4(TDMInput, 1, TDMOutput, 1);

AudioConnection patchCord5(TDMInput, 2, Peak_Ch2L, 0);

AudioConnection patchCord6(TDMInput, 2, TDMOutput, 2);

AudioConnection patchCord7(TDMInput, 3, Peak_Ch2R, 0);

AudioConnection patchCord8(TDMInput, 3, TDMOutput, 3);

AudioConnection patchCord9(TDMInput, 4, Peak_Ch3L, 0);

AudioConnection patchCord10(TDMInput, 4, TDMOutput, 4);

AudioConnection patchCord11(TDMInput, 5, Peak_Ch3R, 0);

AudioConnection patchCord12(TDMInput, 5, TDMOutput, 5);

AudioConnection patchCord13(TDMInput, 6, Peak_Ch4L, 0);

AudioConnection patchCord14(TDMInput, 6, TDMOutput, 6);

AudioConnection patchCord15(TDMInput, 7, Peak_Ch4R, 0);

AudioConnection patchCord16(TDMInput, 7, TDMOutput, 7);

AudioConnection patchCord17(TDMInput, 8, Peak_Ch5L, 0);

AudioConnection patchCord18(TDMInput, 8, TDMOutput, 8);

AudioConnection patchCord19(TDMInput, 9, Peak_Ch5R, 0);

AudioConnection patchCord20(TDMInput, 9, TDMOutput, 9);

AudioConnection patchCord21(TDMInput, 10, Peak_Ch6L, 0);

AudioConnection patchCord22(TDMInput, 10, TDMOutput, 10);

AudioConnection patchCord23(TDMInput, 11, Peak_Ch6R, 0);

AudioConnection patchCord24(TDMInput, 11, TDMOutput, 11);

AudioConnection patchCord25(TDMInput, 12, Peak_Ch7L, 0);

AudioConnection patchCord26(TDMInput, 12, TDMOutput, 12);

AudioConnection patchCord27(TDMInput, 13, Peak_Ch7R, 0);

AudioConnection patchCord28(TDMInput, 13, TDMOutput, 13);

AudioConnection patchCord29(TDMInput, 14, Peak_Ch8L, 0);

AudioConnection patchCord30(TDMInput, 14, TDMOutput, 14);

AudioConnection patchCord31(TDMInput, 15, Peak_Ch8R, 0);

AudioConnection patchCord32(TDMInput, 15, TDMOutput, 15);

//select peak val variables for all 8 channels

int CH1_LPeak, CH1_RPeak, CH2_LPeak, CH2_RPeak, CH3_LPeak, CH3_RPeak,

CH4_LPeak, CH4_RPeak, CH5_LPeak, CH5_RPeak, CH6_LPeak, CH6_RPeak,

CH7_LPeak, CH7_RPeak, CH8_LPeak, CH8_RPeak;

// GUItool: end automatically generated code

void setup()

{

Serial.begin(9600);

AudioMemory(150);

CS42448_Chip.enable();

CS42448_Chip.volume(0.5);

}

void loop() {

}