Snippets

Created by Sergio Araújo
#!/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

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.