Skip to content

Instantly share code, notes, and snippets.

@eiriks
Last active August 29, 2015 14:19
Show Gist options
  • Save eiriks/f76c2b2406f9c7e23d30 to your computer and use it in GitHub Desktop.
Save eiriks/f76c2b2406f9c7e23d30 to your computer and use it in GitHub Desktop.
Test say function in OSX
# Det viste seg å være flere stemmer nå, også en Norsk: Nora, og en Dansk, Sara.
# Voices available to `say` on OS X
# "*" indicates new additions since 10.8
Agnes (en_US)
Albert (en_US)
Alex (en_US)
*Alice (it_IT)
*Alva (sv_SE)
*Amelie (fr_CA)
*Anna (de_DE)
Bad News (en_US)
Bahh (en_US)
Bells (en_US)
Boing (en_US)
Bruce (en_US)
Bubbles (en_US)
*Carmit (he_IL)
Cellos (en_US)
*Damayanti (id_ID)
*Daniel (en_GB)
Deranged (en_US)
*Diego (es_AR)
*Ellen (nl_BE)
*Fiona (en)
Fred (en_US)
Good News (en_US)
Hysterical (en_US)
*Ioana (ro_RO)
*Joana (pt_PT)
Junior (en_US)
*Kanya (th_TH)
*Karen (en_AU)
Kathy (en_US)
*Kyoko (ja_JP)
*Laura (sk_SK)
*Lekha (hi_IN)
*Luciana (pt_BR)
*Mariska (hu_HU)
*Mei-Jia (zh_TW)
*Melina (el_GR)
*Milena (ru_RU)
*Moira (en_IE)
*Monica (es_ES)
*Nora (nb_NO)
*Paulina (es_MX)
Pipe Organ (en_US)
Princess (en_US)
Ralph (en_US)
*Samantha (en_US)
*Sara (da_DK)
*Satu (fi_FI)
*Sin-ji (zh_HK)
*Tarik (ar_SA)
*Tessa (en_ZA)
*Thomas (fr_FR)
*Ting-Ting (zh_CN)
Trinoids (en_US)
*Veena (en_IN)
Vicki (en_US)
Victoria (en_US)
Whisper (en_US)
*Xander (nl_NL)
*Yelda (tr_TR)
*Yuna (ko_KR)
Zarvox (en_US)
*Zosia (pl_PL)
*Zuzana (cs_CZ)
#!/bin/bash
for i in Agnes Kathy Princess Vicki Victoria Alex Bruce Fred Junior Ralph Albert "Bad News" Bahh Bells Boing Bubbles Cellos Deranged "Good News" Hysterical "Pipe Organ" Trinoids Whisper Zarvox
do
echo "<$i> sier det slik:"
# At the beginning of the 21st century, the Umbrella Corporation had become the largest commercial entity in the United States. Nine out of every ten homes contain its products. Its political and financial influence is felt everywhere. In public, it is the world's leading supplier of computer technology, medical products, and healthcare. Unknown, even to its own employees, its massive profits are generated by military technology, genetic experimentation and viral weaponry.
# supercalifragilisticexpialidocious
say -v "$i" "At the beginning of the 21st century... by $i"
# play horn to indicate that we are done.
afplay /System/Library/Sounds/Blow.aiff
# note to self, this is how to save output to file:
# say -v "Cellos" "Lalalalalalalalala" -o recording.aiff
done
#!/bin/bash
for i in Agnes Kathy Princess Vicki Victoria Alex Bruce Fred Junior Ralph Albert "Bad News" Bahh Bells Boing Bubbles Cellos Deranged "Good News" Hysterical "Pipe Organ" Trinoids Whisper Zarvox
do
text[0]="At the beginning of the 21st century..."
text[1]="supercalifragilisticexpialidocious"
#text[2]="At the beginning of the 21st century, the Umbrella Corporation had become the largest commercial entity in the United States. Nine out of every ten homes contain its products. Its political and financial influence is felt everywhere. In public, it is the world's leading supplier of computer technology, medical products, and healthcare. Unknown, even to its own employees, its massive profits are generated by military technology, genetic experimentation and viral weaponry."
text[2]="As a Usenet discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches 1."
text[3]="1. A robot may not injure a human being or, through inaction, allow a human being to come to harm."
text[4]="Don't feed the troll."
text[5]="In the age of information, ignorance is a choice."
text[6]="We accept the love we think we deserve."
text[7]="I am not a man, I am dynamite."
text[8]="The ignorance of how to use new knowledge stockpiles exponentially."
text[9]="I may be wrong, but I’m never in doubt."
text[10]="Oh smeg. What the smegging smeg's he smegging done?"
text[11]="Science is organized knowledge. Wisdom is organized life."
text[12]="A robot's programming doesn't allow for love."
text[13]="I must have some booze. I demand to have some booze."
r=$[ 0 + $[ RANDOM % ${#text[*]} ]]
#echo ${#text[*]}, $r # lenth of array text and rand val from 0 to len(array) exclusive top num
echo "<$i> sier setning $r slik:"
say -v "$i" "${text[$r]} by $i"
# play horn to indicate that we are done.
afplay /System/Library/Sounds/Blow.aiff
# note to self, this is how to save output to file:
# say -v "Cellos" "Lalalalalalalalala" -o recording.aiff
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment