#!/bin/bash 
# set PRBS, wait

echo Connect microphone and provide audio for 30 seconds
echo Press any key when ready
read
amixer sset 'Headphone' 94%
amixer sset 'Playback' '100%'
amixer sset 'Speaker Function' on
amixer sset 'Line In Function' off
amixer sset 'Capture' 100%
amixer sset 'ADC Mux' MIC_IN
amixer sset 'MIC GAIN' 0dB
arecord -t wav -c 2 -r 44100 -f S16_LE -v /tmp/test.input.wav &
sleep 30
killall arecord
echo Press any key when ready to playback
read
aplay /tmp/test.input.wav

