by reuven · 11y ago · 0 comments
So you can do
say -v Samantha Help, I'm trapped in this castle!
or say -v Princess Help, I'm trapped in this castle!
But wait, it gets even better: The Mac comes with a number of voices for other languages, such as French, Hebrew, Chinese, and Arabic. And it turns out that the voices will work in English as well, using that country's accent. I just tried it with a few different languages, and was amazed by how well this worked, within reason: say -v Sin-ji "Hello, I am Chinese. What do you want to eat?"
say -v Thomas "Hello, I am French. What do you want to eat?"
say -v Carmit "Hello, I am Israeli. What do you want to eat?"
And yes, I should get back to work... say -v cellos dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo
Edit: 'In the Hall of the Mountain King' if anyone is curious.There is also 'Pomp and Circumstance':
say -v Good dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum
and Chopin's 'Funeral March': say -v Bad dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum say --voice='?' | perl -lane 'my $v = $F[0]; system("say -v $v \"Hi $ENV{'USER'}\"")' for voice in `say --voice="?" | awk '{print $1}'`; do say -v $voice "Hello $USER, I'm $voice"; doneThat is, typing
say -v Milena "Здравствуйте, меня зовут Milena.
Actually says, "Zdravstvuyte...", while typing say -v Bruce "Здравствуйте, меня зовут Milena.
Results in "Cyrillic capital letter 'Z'. Cyrillic small leter 'd'.", etc.I don't think that Apple has created the World's Best Accent Impersonator here, but it's good for a few laughs.
1, the pedantic: technically none of them know how to speak English, or any other language - there's just a rule set for making phonemes based on characters out of waveforms.
2. Ignoring the pedantic response, I still don't think that's true - if that were the case, then Milena wouldn't be able to speak an English sentence!
say -v Milena "Hello, I am Milena"
If they only speak their own language, then Milena should be saying "Прописная буква Х, строчная буква и", etc. say -v Anna 'über allen Wipfeln ist Ruh'
say -v Anna '[[lang fr_FR]] que restet-il de nos amours'
say -v Anna '[[lang it_IT]] chi nasce asino non muore cavallo'
say -v Anna '[[lang es_SP]] nosotros tenemos mas influencia con sus hijos que su tiene'
say -v Anna '[[lang en_UK]] are we having fun yet?'I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.
If it were open source you could probably get better results by hacking it up to parse in the "right" language and then only realizing the phonology in the "wrong" language, instead of both parsing and speaking in the "wrong" language.
say -vjun "[[inpt TUNE]] h {D 100; P 233.08:0 233.08:100} OW {D 200; P 233.08:0 233.08:100} l {D 100; P 220:0 220:100} IY {D 200; P 220:0 220:100} f {D 100; P 233.08:0 233.08:100} AA {D 500; P 233.08:0 233.08:100} k {D 100; P 174.61:0 174.61:100} IY {D 500; P 174.61:0 174.61:100} n {D 50; P 174.61:0 174.61:100} g {D 50; P 174.61:0 174.61:100} S {D 100; P 155.56:0 155.56:100} IH {D 400; P 155.56:0 155.56:100} t {D 100; P 155.56:0 155.56:100} IH {D 200; P 233.08:0 233.08:100} t {D 100; P 233.08:0 233.08:100} s {D 100; P 233.08:0 233.08:100} AA {D 200; P 220:0 220:100} d {D 100; P 233.08:0 233.08:100} AY {D 500; P 233.08:0 233.08:100} n {D 100; P 174.61:0 174.61:100} OW {D 400; P 174.61:0 174.61:100} s {D 200; P 155.56:0 155.56:100} OW {D 500; P 155.56:0 155.56:100} r {D 200; P 155.56:0 155.56:100}"Which is rather lovely, because someone in Apple HQ has decided that the (London) band Saint Etienne must be French, and so Thomas faithfully reports that the current track is "Leek a Motorweh".
http://greggman.github.io/text2speech/
There's also some singing like voices.