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
|
osVoiceGetReadDataSyntax#include <ultra64.h> s32 osVoiceGetReadData(OSVoiceHandle *hd, OSVoiceData *result);
Explanation
The recognition result is stored in result of the OSVoiceData structure. The contents of the OSVoiceData structure are as follows. typedef struct { u16 warning; /* Warning */ u16 answer_num; /* Candidate number (0~5) */ u16 voice_level; /* Voice input level */ u16 voice_sn; /* Relative voice level */ u16 voice_time; /* Voice input time */ u16 answer[5]; /* Candidate word number */ u16 distance[5]; /* Distance value */ } OSVoiceData; The warning member variable of the OSVoiceData structure is the warning which pertains to the recognition result. The following bits are flagged when there is any problem with the recognition result.
Table 7 Bits Flagged When There is a Problem with the Recognition Result
The "answer_num" member variable is the number of valid candidates. This is the number of words judged by the Voice Recognition System being valid as candidates. It is a value from 0 to 5. If this is 0, there are no valid candidates. The "voice_level" member variable is the level of the input voice. The greater the voice input, the larger this value is. The "voice_sn" member variable is the relative level of the voice input to the noise input. The voice_time member variable is the voice input time in ms units. The "answer[]" member variable is the numbers of the words from the 1st candidate to the 5th candidate. The word numbers are always output from the 1st candidate to the 5th candidate, but those which are deemed by the Voice Recognition System to be valid are numbered as candidates from the first to number of words in answer_num. Normally, answer[] is a value 0 ~ 0x00ff, but if there are no suitable words, its value is 0x7fff. The "distance[]" member variable is the distance value of the word from the 1st candidate to the 5th candidate. The more similar the word, the smaller this value is. Before calling the osVoiceGetReadData() function, voice recognition processing must be started with the osVoiceStartReadData() function. 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_NOT_READY
CONT_ERR_VOICE_NO_RESPONSE
CONT_ERRO_CONTRFAIL
CONT_ERR_INVALID
See Also
|