YAAQ (yet another apple question)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

YAAQ (yet another apple question)

Post by bob »

Someone asked me how to set up Crafty's "speech" on a mac. I had no idea. Worked trivially under linux, but I do not see anything similar to "esdplay" or anything close for the mac. Most are running Yosemite. Any suggestions?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

The "say" command is what you want

Post by sje »

Code: Select all

say "This is a test."
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: The "say" command is what you want

Post by JoshPettus »

User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: The "say" command is what you want

Post by stegemma »

sje wrote:

Code: Select all

say "This is a test."
It is better to use single quotes, as you can see by executing the following commands:

Code: Select all

say "This is a Test!"
say 'This is a Test!'
The first one gives an error related to a missing event (?) and the second one works fine.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: The "say" command is what you want

Post by sje »

stegemma wrote:
sje wrote:

Code: Select all

say "This is a test."
It is better to use single quotes, as you can see by executing the following commands:

Code: Select all

say "This is a Test!"
say 'This is a Test!'
The first one gives an error related to a missing event (?) and the second one works fine.

Code: Select all

say 'You'll see that's not always a good idea.'
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: The "say" command is what you want

Post by stegemma »

sje wrote:
stegemma wrote:
sje wrote:

Code: Select all

say "This is a test."
It is better to use single quotes, as you can see by executing the following commands:

Code: Select all

say "This is a Test!"
say 'This is a Test!'
The first one gives an error related to a missing event (?) and the second one works fine.

Code: Select all

say 'You'll see that's not always a good idea.'

Code: Select all

say Yes but it works even without quotes!
stevenaaus
Posts: 608
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: The "say" command is what you want

Post by stevenaaus »

say "This is a Test!"
You are just running into a bash (the modern default unix command shell) nuance/feature.
Single quotes (') are literal, but bash will try to do variable expansion inside double quotes ("). The exclamation mark has significance.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

And in the other direction

Post by sje »

And in the other direction:

https://developer.apple.com/library/mac ... index.html

I did some work with this long ago. The basic idea is to supply a library recognition routine with a list of strings, each string being the text version of speech to be recognized. A spoken phrase is compared to the voice synthesis data for each of the strings and the best match is returned.
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: The "say" command is what you want

Post by mvk »

sje wrote:

Code: Select all

say 'You'll see that's not always a good idea.'
I tested this and this case works fine.
[Account deleted]