Needs to mention afplay for playing audio! You can easily use this to make a command-line MP3 player. Others have mentioned the “say” utility for speech synthesis. There is a lot you can do with it, it supports the TUNE format, which allows you to "shape the overall melody and timing of an utterance... for example ... to make an utterance sound as if it is spoken with emotion". See: Apple's Speech Synthesis Programmi…
macOS command-line tools you might not know about
451–454 of 454 posts
Thank you for the article :)
One small correction, the command to list the voices is `say -v '?'`
Re: macOS command-line tools you might not know about
#452Re: macOS command-line tools you might not know about
#453Super cool.
Re: macOS command-line tools you might not know about
#454Great list, working with Mac a long time and found some good things here. This might be useful too:
# cd to frontmost open finder folder (in Terminal cd to the current top finder window) cdf() { cd "`osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)'`"; pwd; }
# Copy the frontmost open finder folder Path from Terminal to the Clipboard in MacOS: cpf() { echo "`osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)'`"|pbcopy; }
# open manpage in preview app: pman() { mandoc -T pdf "$(/usr/bin/man -w $@)" | open -fa Preview; }
# Function to delete a given line in ssh known_hosts file: xho() { line=$1;tFile="$HOME/.ssh/known_hosts";sed -e "${line}d" -i ".tmp" "$tFile";}