Page 1 of 2
how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 4:12 pm
by fpierron
Hi,
As you may have seen, osx Lion offers now speech in many languages (not only english but fr, de, sp, etc...).
How to use it in LiveCode ?
1/ Enable new voices if the user didn't do that : you have to donwload them.
2/ Select the right voice
3/ modify the speed
4/ send strings to voices
I can't find function related to that.
Best,
Frédéric
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 4:29 pm
by Klaus
Bonjour Frédéric,
1/ Enable new voices if the user didn't do that : you have to donwload them.
Since this is a feature built into the OS, I doubt that you can do this via LiveCode.
2/ Select the right voice
3/ modify the speed
Check "revSpeech" in the dictionary!
But I am not sure if they work correct with the new voices in Lion!
EDIT!
Just checked, they do work!
4/ send strings to voices
See above but can also us SHELL to do so:
...
put "Bonjour Frédéric, ça va bien?" into tString
get shell("say" && tString)
...
Works great with the new german voices!
Best
Klaus
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 4:38 pm
by jmburnod
Bonjour Frédéric,
Check also "revstopSpeech" in the dictionary
Klaus said :
See above but can also us SHELL to do so:
put "Bonjour Frédéric, ça va bien?" into tString
get shell("say" && tString)
Is there an equivalent of "revstopSpeech" with the shell command ?
Best
Jean-Marc
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 4:50 pm
by Klaus
Hi Jean-Marc,
sorry, no idea.
You can check the man pages for SAY, enter this into the TERMINAL:
man say
Best
Klaus
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 4:55 pm
by Klaus
Hm, since SHELL calls are blocking in LiveCode, this doesn't matter at all
But REVSPEAK should work!
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 7:45 pm
by fpierron
Tanks a lot.
I Will mâle some try.
Do you think it possible to record The VoiceOver generated by The synthetiser ?
Best,
Frédéric
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Aug 16, 2011 9:38 pm
by Mark
Hi Frédéric,
eSpeak isn't as beautiful as Lion's speech feaures, but it is cross-platform (inlcuding Mac) and available in quite a few languages. It can also be used to create sound files.
Regarding Lion's speech, you can use the revSetSpeechVoice command to change voices. I'd expect to be able to select a voice in a different language. Use the revSpeechVoices function to see a list of all voices available to LiveCode.
Kind regards,
Mark
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Wed Aug 17, 2011 10:08 am
by fpierron
Thanks for the information but I need something that do not need to be downloaded apart from my app.
Frédéric
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Wed Aug 17, 2011 11:19 am
by bn
Hi Frédéric,
here is a little stack that lets you type/paste text into a field. This text is then put into an AppleScript and send off. It will create a sound file (.aif) on the desktop with the text spoken with the current voice.
Works only on a Mac due to Applescript.
I did not test on Lion but it works on Snow Leopard. Should work on Lion also.
Kind regards
Bernd
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Wed Aug 17, 2011 1:39 pm
by Klaus
Bonjour Frédéric,
fpierron wrote:Do you think it possible to record The VoiceOver generated by The synthetiser ?
yes, check the example of Bernd that uses AppleScript, but this can also be done via SHELL, if you like this better
Open the terminal and type:
man say
Hit enter and see all possible options for this shell command.
Best
Klaus
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Thu Mar 22, 2012 7:32 pm
by jmburnod
Hi Bernd,
Should work on Lion also.
Yes. I tested it
Best from Geneva
Jean-Marc
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Thu Mar 22, 2012 11:08 pm
by bn
Hi Jean-Marc,
thanks for testing. I am still not on Lion yet.
I gather that you are into compiling externals. Wow. Xcode / C, objective C scare me to death.
Kind regards
Bernd
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Thu Mar 22, 2012 11:27 pm
by jmburnod
Hi Bernd,
Wow. Xcode / C, objective C scare me to death.
Me too.
I'm not the author, i just have found a way to use it for iPad
Kind regards
Jean-marc
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Mon Mar 26, 2012 10:12 pm
by jmburnod
Hi All,
It seem Applescript is the only one way to speak a language with diacritical chars and apostrophe
• RevSpeak don't speak a string with diacritical chars
• Shell don't speak a string with an apostrophe
The best way should be LiveCode fix the revspeak.
Someone know something about this in LC 5.5 ?
Best regards
Jean-Marc
Re: how to use Speech / Parole feature on osX Lion ?
Posted: Tue Mar 27, 2012 12:47 pm
by Mark
Hi Jean-Marc,
You can use apostrophs in the shell if you put the entire string inside quotes or if you escape the apostrophe with a preceding backslash.
The shell understands UTF8, which means you can use any character if you convert it to UTF8 first. I'm not sure that you can call the shell using UTF8 from LiveCode, but you can write a simple shell script to disk, change the permissions and use the shell to run it:
put "say" && quote & "Je suis à l'école" & quote into url "binfile:talk.sh"
get shell("chmod 755 talk.sh")
get shell("talk.sh")
Kind regards,
Mark