←back to thread

700 points yen223 | 1 comments | | HN request time: 0.218s | source
Show context
RandallBrown ◴[] No.42065658[source]
A fun easter egg in the "say" command is that "OS X" is said as "Oh Ess Ten".

You can also change voices with -v. My favorite is "cellos" since it sings to you.

replies(3): >>42065753 #>>42066421 #>>42067935 #
1. ramses0 ◴[] No.42067935[source]
Other cute `say` tricks: muck around with OSX Default Speech Voice (to a siri-ish voice) and you can invoke that from the CLI.

I hacked together a little script for demo recording like:

    START_FROM="$1"
    STARTED=0
    function transcript() {
       ID="$1"
       TO_SAY="$2"
       if [[ ...STARTED || START_FROM && ID... ]]; then
          STARTED=1
          say "$TO_SAY"
       fi
    }

    transcript "STEP001" "This is a test"
    transcript "STEP001b" "of the emergency broadcast system"
    transcript "STEP002" "This is only a test, if this was ..."
    transcript "STEP003" "...etc..."
...and then I have a hardcoded `--output` which will then change the invocation to `say -o "$ID.wav" "$TO_SAY"` and output audio files.

That way I can iterate on voiceover scripts, eg: `./demo-script "STEP002"` => `./demo-script --output`

It's really helpful for iterating on pronunciations, eg: `transcript "STEP005" "In case of Four Hundred and Four errors..."`, I can just "skip to" and iterate against that line (and subsequent ones), or "skip back" and hear it in more of a flowing context.

...even if I don't end up using the `say`-generated audio, having a transcript (and even pacing) that I can just read through with my own voice is super helpful.