12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #! /bin/bash
- echo "talkii usage: talkii <chandirhere>"
- #making sure we dont just repeat the line indefinitely...
- last_line=""
- while true; do
- current_line=$(tail -n1 "$1/out" | cut -d ' ' -f 2-)
- if [[ "$current_line" != "$last_line" && -n "$current_line" ]]; then
- #here we output, and play with mpv, more reliable, more options, then playing direct through flite.
- echo "$current_line" | flite -o /tmp/talkii_audio.wav
- mpv --no-terminal --speed=1.5 --no-cache /tmp/talkii_audio.wav
- last_line="$current_line"
- fi
- sleep 1
- done
- #future fiitures:
- # talkii plays different voice per nick
- # the old original initial (pseudo)code idea outline, saved here for posterity:
- # #echo "talkii usage: talkii <chandirhere>"
- # #templine:
- # echo "run flite -l -f talk"
- # #the gist of what i want
- # #tail -n1 out | flite -t $1
- # # this works... sorta.
- # #with
- # #flite -l -f talk
- # #also running
- # watch -n1 -g stat -f out ;and tail -n1 out > talk ;and sleep 1 ;and echo > talk
- # talkii
- # #this "works".
- # #as in, it wont loop saying the whole of everything forever, and no need to wipe the out file.
- # #it's very janky and unreliable, but gets me to the next ballpark of development n cleaning this up to work cleaner, smarter, better.
- # ### so.... seriously this is jaaaaaank. janky janky. so many holes it wont catch. so, need to tighten it up, n get it such that it wont freak out, wont repeat things, wont miss things, wont need 2 commands running for it (get the flite into it)
|