A guide for using Tolk is as follows:
Using tolk in your PureBASIC projects
Using tolk in your PB projects
To use tolk in your PB projects, just use the following code:
Next, go to the initialization part of your project and enter the following at the bottom, top, or wherever you need it:
This loads the tolk library. Next, wherever you need it, do:
Alternatively, create a say() function like this:
Procedure say (text.s)
The following functions are in the tolk library. Note that tolk:: must be prepended to each function.
Loads the tolk library into memory. Typically used at the top of your code, or wherever you initialize your application.
Specifies if the tolk library is loaded or not. Returns #True if tolk is loaded and #False otherwise.
Used to unload the tolk library. Generally used when the application exits.
Tests if SAPI is available. Requires an ASCII number (0-255) to test. Returns #True on success and #False otherwise.
Forces the tolk library to prefer SAPI output in tolk::output(). Requires a SAPI voice ID (0-255).
Causes tolk to run a check of all screen readers running on the system. Returns a string containing the screen readers name.
Detects if the screen reader supports speech output. Returns #True if the screen reader supports speech output, #False otherwise.
Detects if the screen reader supports braille output. Returns #True on success, #False otherwise.
Output(str.s, interrupt.a = #False)
Forces the screen reader currently loaded to speak something.
Speak(str.s, interrupt.a = #False)
See Output() above.
Causes the screen reader currently loaded to send data to the braille display's display. Requires text to send to the display. This can be included in your say() function.
Requests tolk to check if the screen reader currently loaded is speaking. Returns #True if the screen reader currently loaded is speaking, #False otherwise.
Forces the screen reader to stop speaking immediately. Return #True if the screen reader was silenced successfully and #False otherwise.
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." — Charles Babbage.