al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
osVoiceSetWordSyntax#include <ultra64.h> s32 osVoiceSetWord(OSVoiceHandle *hd, u8 *word)
Explanation
hd is the Voice Recognition System control structure. The Voice Recognition System must be initialized with the osVoiceInit() function before the osVoiceSetWord() function is called. The word (SJIS) to be registered is specified in "word." The word can be up to 17 characters long. Since calling the osVoiceSetWord() function once registers one word, execute osVoiceSetWord() multiple times to register multiple words. The number of words registered must match the number set by the osVoiceClearDictionary() function. Please note that an error will be generated when the osVoiceStartReadData() function is executed, if the number of words registered is greater than or less than the specified number of words. The maximum number of words which can be registered in the dictionary is about 80 words, assuming 5 syllables per word. Therefore, while the maximum number of words which can be registered is set at 255, if there are several syllables per word, the dictionary may subsequently overflow the memory. In this case, voice recognition can be executed without an error being caused by the osVoiceStartReadData() function even if the number of registered words is less than the number set by the osVoiceClearDictionary() function. The characters which can be registered and their codes are shown in the table below.
In addition, the following restrictions apply to character combinations when registering words. Use the osVoiceCheckWord() function to check whether or not the word that you are trying to register can be registered in the Voice Recognition System. Use this in the case of game applications in which registered words will be input during debugging or by the game player.
The returned value is an error code. A 0 (zero) is returned when processing ends normally. If an error occurs, this function has the following error codes.
CONT_ERR_NO_CONTROLLER
CONT_ERR_DEVICE
CONT_ERR_VOICE_NO_RESPONSE
CONT_ERRO_CONTRFAIL
CONT_ERR_INVALID
CONT_ERR_VOICE_WORD
CONT_ERR_VOICE_MEMORY
See Also
|