←back to thread

700 points yen223 | 5 comments | | HN request time: 0.421s | source
1. 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 #
2. robertoandred ◴[] No.42065753[source]
Not sure that's an easter egg? That's been the pronunciation for 25 years.
replies(1): >>42065815 #
3. mholm ◴[] No.42065815[source]
It's at least manually programmed in. Otherwise it would have said 'Ecks'
4. staplung ◴[] No.42066421[source]
It actually understands roman numerals, to a certain extent. E.g. `say LVIII` will say "58". However, `say MCMLXXIX` speaks some gibberish that ends in the word "six", for some reason.

It also knows how to say numbers up into the trillions but not more than that (although I feel like it used to).

5. 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.