« Container | Home | Window Activation Tri… »

Teach your solution to talk

Do you already know the Speech component from the MBS FileMaker Plugin?

With it you can easily make your application speaking. The functions I will show you in this article, can be used on Mac and Windows under FileMaker Desktop and the iOS SDK. Reading text out loud is especially useful if you are writing a solution for people who cannot read or have a visual restriction. You can use the Speech.Speak function to output text. Besides the text you can also specify the speaker you want to use. You can find a list of speakers that are available for your system with the function Speech.AvailableVoices.

In addition, we can specify in the Speech.Speak function whether the script should be stopped during the speech output or should continue to run. Stopping the script makes sense especially when different texts are to be read out. Otherwise it can happen that only the last text is read aloud because only one speech output is possible at the same time. Furthermore we can define a value for the playback volume. This is between 0.0 which stands for mute and 1.0 which stands for full volume. Last but not least, we can set the speed of the voice. This can be between 0.5 for half speed and 2.0 for double speed in relation to the default speed. The output of the text "Hello" can look like this:

Set Variable [ $r ; Value: MBS("Speech.Speak";"Hello"; "com.apple.speech.synthesis.voice.Alex";1 ; 0.8; 1.2 ) ]

With longer texts it can be helpful if the user can pause the speech in order to continue it later. For this you have the function Speech.Pause available. With the function Speech.Resume the reading can be continued. So that your program can recognize whether a text is currently being read out, the functions Speech.IsSpeaking and Speech.IsPaused are available. If you want to stop the current text completely, use the function Speech.Stop.

I hope you enjoyed this short excursion. If you have any questions, please feel free to contact us.

Claris FileMaker Plugin
22 10 22 - 10:11