Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 07, 2019 9:07 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: NSSpeechSystem using MBS Plugins again
PostPosted: Sun Aug 29, 2010 7:03 pm 
Offline

Joined: Sat Jan 23, 2010 3:03 pm
Posts: 244
Location: Ohio, USA
I am trying to get the NSSpeechSynthesizer from the MBS plugin to work
The code below says you must use the value returned by this function
speech.setVoice("com.apple.speech.synthesis.voice.Alex")

I don't know what that means and how to fix my error

if alex.value=true then
speech.setVoice("com.apple.speech.synthesis.voice.Alex")
dim s as new NSSpeechSynthesizerMBS
s.rate=300 // not slow
s.volume=0.5 // not loud
call s.startSpeakingString va_main.vaedit.text
end if


Brian


Top
 Profile  
Reply with quote  
 Post subject: Re: NSSpeechSystem using MBS Plugins again
PostPosted: Mon Aug 30, 2010 3:57 am 
Offline

Joined: Mon Aug 20, 2007 9:42 am
Posts: 190
The function setVoice must return some value, perhaps an integer as an OSStatus, or perhaps a boolean to report success in completing it.

Say you have a function:
Function fooBar(input as String) as Integer


This means that the function fooBar returns a value of type Integer, so you cannot call the function like this:
fooBar("myInput")


you must do it like this:
dim returnValue as Integer
returnValue = fooBar("myInput")


That should be everything you need to know.


Top
 Profile  
Reply with quote  
 Post subject: Re: NSSpeechSystem using MBS Plugins again
PostPosted: Mon Aug 30, 2010 4:35 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
If you look on the methods here:

http://www.monkeybreadsoftware.net/clas ... rmbs.shtml

you see "SetVoice(voice as string) as boolean". So Setvoice returns a boolean to tell you about success (true) or failure (false).

You can ignore the result and use "call" before Setvoice.

I highly recommend that you offer a popupmenu or listbox in your application. You fill it the example code here:

http://www.monkeybreadsoftware.net/exam ... izer.shtml

This way you can load the voices list, display it with displayname and attributes (gender, language, age) and let the user choose one.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group