Velocity powered by Wavelink

> Managing Projects > Using Speakeasy > Grammar Files > Setting Read Modes

This page refers to an older version of the product.
View the current version of the User Guide.

Setting Read Modes

By default, the Speakeasy engine reads specific screen elements to identify fields and screens. Through the use of scripting, you can inject additional dialogue to screens or fields. The Voice.speak API offers the ability to speak a sentence or group of words.

The words and numbers specified with this script API do not need to be included in your grammar files.

The example below shows a simple script for speaking text to a task worker with a variable for an array of integers:

/* Speaking text from the screen back to the task worker.

*/

var text = Screen.getText(12, 5, 20);

Voice.speak(text);

This next example simplifies the script for a string consisting of two words:

/* Speaking text from the device back to the task worker.

*/

Voice.speak('Hello World');

Sentence or Character Mode

When Speakeasy uses text-to-speech, it reads phrases in one of two ways. By default, it reads in sentence mode, meaning it doesn't spell out each word or read numbers individually. You can alter this by specifing modes that force it to read individual characters, or whole words.

/* Speaking each character from the device back to the task worker.

*/

var text = Screen.getText(1234);

Voice.speak({readmode:character}text);

For example, with the sentence read mode, it would register "1234" as "one thousand two hundred thirty-four". In character mode, it would instead read each number individually, "1-2-3-4".

The same logic applies to letters, with sentence reading words in their entirety and character spelling out the word.

The example below shows the read mode command alongside other commands that alter speed, pausing, and resetting to voice defaults.

/* Speaking text from the screen back to the task worker. It reads the following phrase in sentence mode at half speed with a five-second pause, with the speaking settings reset at the end.

*/

Voice.speak('{readmode:sentence}{cadence:50%}Hello{pause:medium}World{reset}');

The example above illustrates how you can alter spoken phrases using the Voice.speak API.

Commands

Read Mode
Sentence {readmode:sentence} Reads the string as words and sums. For example it would read the following phrase as words: "Hello world". Numbers would likewise be read: "1,234".
Character {readmode:character} Reads the string as individual letters and numbers. For example, it would spell out the following phrase: "H-E-L-L-O-W-O-R-L-D". Numbers would likewise be read: "1-2-3-4".

 

Cadence
{cadence:50%} Increases or slows down the rate of speech. The default value is 100%.
{cadence:75%}
{cadence:100%}
{cadence:150%}
{cadence:200%}

 

Pause
{pause:short} Injects a short pause between words or letters. The duration of this command is 250 milliseconds, or 0.25 second.
{pause:medium} Injects a short pause between words or letters. The duration of this command is 500 milliseconds, or 0.5 second.
{pause:long} Injects a short pause between words or letters. The duration of this command is 1000 milliseconds, or 1 second.

 


This page refers to an older version of the product.
View the current version of the User Guide.

The topic was:

Inaccurate

Incomplete

Not what I expected

Other