Skip to content

Commit

Permalink
Add command-line wrapper for ipa-reader.xyz
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Apr 14, 2024
1 parent aeb4cfd commit dba9daa
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,30 @@ gzcmp(){
unset origsize gzipsize ratio
}

# Read IPA notation out loud
ipa(){
case $* in *[![:blank:]/\|]*) ;; *)
>&2 printf 'Usage: ipa [text-in-ipa-notation]\n'
return 1;;
esac
printf '{"text": "%s", "voice": "Nicole"}' "$*" \
| curl -qLfSs --data @- -X POST \
-H Content-Type:\ application/json \
'https://iawll6of90.execute-api.us-east-1.amazonaws.com/production' \
| jq -r | base64 -d | {
if command play --help | grep -iq SoX; then
play -qt mp3 -
elif command -v ffplay; then
ffplay -loglevel 0 -nodisp -autoexit -
elif command -v aucat && command -v lame; then
lame -r --decode --mp3input - /tmp/ipa.wav &&
aucat -i /tmp/ipa.wav
elif command -v audacious; then
audacious -qH -
fi
} >/dev/null 2>&1
}

# Print geographical location of an IP address
iplocation(){
[ $# -eq 0 ] && {
Expand Down

0 comments on commit dba9daa

Please sign in to comment.