Knowledge Base

# SpeakNumb(n:Number{, L:Language}{, c:Country}{, q:ClearQueue}) hash function

Valid for use with hash command: HMI. Arguments may be specified as Name:Value Pairs

Implemented on the following platforms: Android, Windows (limited support)

This uses the Android text to speech engine to say a number out loud.

Number is the number to be spoken. It can be a literal number or a numeric formatting function.

Language is the language to be spoken, and is specified as two lower case letters. Language codes. The target language must be installed in the Android device.

Country is the country specific variant (“dialect”). This is specified as two upper case letters. Country codes.

ClearQueue, if a non-zero number, will result in any previously queued text being deleted. Otherwise the text for successive Speak functions is queued up. Hitting the Android device with too much speech data, too rapidly, could cause problems.

Example: The following tiny program will count out loud on an Android device.

(Click here for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help (.chm) files)

HMIPort         EQU     252                ;Give serial port 252 a name

#Open_Serial Port(HMIPort) User(9600,8,N) ;Open serial port 252, set User protocol
# HMI Port(HMIPort) ;Assign the serial port to the HMI function
LaunchTask tskCount ;Launch the counting task
RunTasksForever ;Start MultiTrack

;The counting task.
;NOTE: 32 bit boards like the EC1 preserve registers, like W, for individual tasks.
; That's why this program can keep the counter in W. That would not work with
; an older 8-bit controller like MS121. See the counter task in SpeakText, which
; has to keep the counter in a RAM variable.
tskCount:
fLoadW 0 ;Initialise the counter - using register U
fLoadQ 1 ;Count up by this amount
Count1:
fAdd ;Count up
#HMI SpeakNumb(n:f(=w, 5, 0)) ;Speak
Pause 200 ;Delay
GoTo Count1 ;Repeat