37 lines
1.0 KiB
Bash
Raw Normal View History

2022-07-18 22:49:18 +03:00
#!/bin/sh
# Pin logic
#selecting pin
2022-07-20 19:03:17 +01:00
GPIO=19
2022-07-18 22:49:18 +03:00
# "Prepare" it, whatever that means, I just copied it from SO
if [ ! -d /sys/class/gpio/gpio${GPIO} ]; then
echo "${GPIO}" > /sys/class/gpio/export
fi
echo "in" > /sys/class/gpio/gpio"${GPIO}"/direction
# old line
#(while true; do cat sampleaudio.wav; done)
while true; do
2022-07-20 19:03:17 +01:00
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
2022-07-18 22:49:18 +03:00
# REMOVE THIS
else
2022-07-20 19:03:17 +01:00
echo "Not pressed"
2022-07-18 22:49:18 +03:00
# do arecord -l or arecord -L to find your audio card and change hw:0,7 to the corresponding value
# maybe i just need to extract this command and put it in a subprocess... 🤔
fi
sleep .5
done
# this should work
# screen will probably be operated using python, so all we need to do there is to killall ssb.sh, then run a new one with new freq async subproc
# usage: bash ssb.sh "freq"