almost got the PTT working

This commit is contained in:
PiFestim
2022-07-20 19:03:17 +01:00
parent a367c27c92
commit dbf1900f56
4 changed files with 59 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# Pin logic
#selecting pin
GPIO=26
GPIO=19
# "Prepare" it, whatever that means, I just copied it from SO
if [ ! -d /sys/class/gpio/gpio${GPIO} ]; then
@ -17,15 +17,15 @@ echo "in" > /sys/class/gpio/gpio"${GPIO}"/direction
#(while true; do cat sampleaudio.wav; done)
while true; do
if [ 1 == "$(</sys/class/gpio/gpio"${GPIO}"/value)" ]; then
if 1 == "$(</sys/class/gpio/gpio"${GPIO}"/value)" ]; then
arecord -q -f cd -r 44100 -c2 -D hw:0,7 -t raw | csdr convert_i16_f \ | csdr fir_interpolate_cc 2 | csdr dsb_fc \ | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff \ | sudo sendiq -i /dev/stdin -s 96000 -f "$1" -t float
# REMOVE THIS
echo "Not pressed"
else
echo "Not pressed"
# do arecord -l or arecord -L to find your audio card and change hw:0,7 to the corresponding value
arecord -q -f cd -r 44100 -c2 -D hw:0,7 -t raw | csdr convert_i16_f \ | csdr fir_interpolate_cc 2 | csdr dsb_fc \ | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff \ | sudo ./sendiq -i /dev/stdin -s 96000 -f "$1" -t float
# maybe i just need to extract this command and put it in a subprocess... 🤔
fi