Changing Text-to-Speech Modes

When you use text-to-speech, the mode determines if it reads character strings as words or pronounce each letter separately. The text-to-speech mode is configured using the tts_readmode setting. The following example script demonstrates how to change the text-to-speech mode working in a voice-picking environment.

The following script also repeats picking information from the screen when the user requests it. This script is named sapRepeatPrompts and is designed to work with the script available in Acquiring a Pick Quantity in the Industrial Browser.

Script( sapRepeatPrompts )
String( strPromptBin )
String( strPromptBinValue )
String( strPromptMaterial )
String( strPromptMaterialValue )
String( strPromptBatch )
String( strPromptBatchValue )
String( strPromptQuantity )
String( strPromptQuantityValue )
String( strSearchString )
Number( nReadMode )
Number( nIndex )

Comment: This function repeats the prompts when called from Command and Control.
Speech_To_Text_Cancel

Comment: The Speech-to-Text and Text-to-Speech languages are specified.
Speech_Change_Setting( "tts_language_short", Speech_Find_Setting_Value("tts_language_short", "enu", FALSE))
Speech_Change_Setting( "stt_language_short", Speech_Find_Setting_Value( "stt_language_short", "enu", FALSE))

Comment: Ensure read mode is in sentence mode.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "sentence", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annunciate Bin prompt.
Speech_From_Text( strPromptBin, TRUE )

Comment: Change read mode to character mode to annunciate bin number.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "character", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annuciate Bin number.
Speech_From_Text( strPromptBinValue, TRUE )

Comment: Change read mode back to sentence mode to annunciate material prompt.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "sentence", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annunciate Material prompt.
Speech_From_Text( strPromptMaterial, TRUE )

Comment: Change to character mode to annunciate material.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "character", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annuciate Material.
Speech_From_Text( strPromptMaterialValue, TRUE )

Comment: Change to sentence mode to annunciate batch prompt.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "sentence", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annunciate Batch prompt.
Speech_From_Text( strPromptBatch, TRUE )

Comment: Change to character mode to annunciate Batch.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "character", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Annuciate Batch.
Speech_From_Text( strPromptBatchValue, TRUE )

Comment: Change to sentence mode to annunciate pick quantity.
nReadMode = Speech_Find_Setting_Value( "tts_readmode", "sentence", FALSE )
Speech_Change_Setting( "tts_readmode", nReadMode )

Comment: Extract quantity value left of the period.
strSearchString = "."
nIndex = String_Find_First( strPromptQuantityValue, strSearchString, TRUE )
strPromptQuantityValue = String_Left( strPromptQuantityValue, nIndex )
strPromptQuantityValue = String_Trim_Spaces_Start( strPromptQuantityValue )

Comment: Annunciate Pick Quantity prompt.
Speech_From_Text( strPromptQuantity, TRUE )

Comment: Annunciate Pick Quantity Value.
Speech_From_Text( strPromptQuantityValue, TRUE )

Return

 


Was this article useful?    

The topic was:

Inaccurate

Incomplete

Not what I expected

Other

Privacy and Legal