1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/data/data/com.termux/files/usr/bin/bash # vim: trap 'saida' INT saida(){ clear echo -e "\n\tsaido do programa dictation" sleep 2 clear exit 1 } while true; do audio=$(ls ~/docs/dictation/* | shuf -n 1) duration=$(soxi -D "$audio" | awk -F. '{print $1}') if [[ $duration -gt 1 ]]; then clear echo echo -e "\n\tplaying ${audio##*/}" mpv --really-quiet "$audio" sleep 1 fi done
You can clone a snippet to your computer for local editing. Learn more.