REALbasic – Speak Method line

REALbasic offers a Speak Method that allows us to use the computer’s speech synthesizer to pronounce the passed text string (Windows and Macintosh only). It’s very easy to use so lets look how Speak Method work.

Speak Method in REALbasic

Speak takes a string (or any variant that can be expressed as a string) and uses the Windows or Macintosh text-to-speech engine to speak the text. The speech is asynchronous, allowing normal program flow to continue. By default, subsequent calls to Speak before the first call has finished will queue up and speak after the completion of the previous call. If the optional interrupt flag is used and set to True, the previous Speak calls will be stopped immediately. Speak is not supported on Linux.

Speak Method example

We can for example read the text available in TextArea Control. I hope this example is clear to understand. If you like you can change some settings (like system voice, reading speed etc.) in System Preferences -> Speech. I think that Windows offers also this kind of options somewhere.

1
2
3
4
5
if TextArea1.Text < > "" then
  speak TextArea1.Text
else
  speak "Please insert some text in TextArea because it's empty"
end if

Author: Jakub Pawlak

I'm interested in all. Currently working on the development of TUTSPOLIS and I hope that in near feature the project will be successful.

One Response to “REALbasic – Speak Method”

  1. that guy says:

    thanks
    your tutorials are really helpful…i’m just starting realbasic and it can get really fustrating!

Leave a Reply

Copyrights (c) TUTSPOLIS | Powered by Wordpress MU | Inspired at Elegant Themes designed by qbap (HTML5 & CSS3)