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
|
osVoiceInitSyntax#include <ultra64.h> s32 osVoiceInit(OSMesgQueue *siMessageQ, OSVoiceHandle *hd, int channel);
Explanation
It is recommended that you check to see which device is connected to a particular port prior to initialization. Standard controllers and peripheral devices other than the Voice Recognition System may be inserted into the controller ports as well. This check can be accomplished with the osContStartQuery() function and the osContGetQuery() function. The Voice Recognition System is connected if the value of the member variable "errno" of the OSContStatus structure is 0 (zero), and if the AND (logical product) of the value for type and CONT_TYPE_MASK is CONT_TYPE_VOICE. siMessageQ is the message queue initialized in connection with OS_EVENT_SI. Please refer to the osSetEventMesg() function in the "N64 Function Reference Manual," regarding how to establish this connection. channel is the channel number of the controller port to which the Voice Recognition Unit is connected. It is a value 0~3. The Voice Recognition System control structure OSVoiceHandle is configured as follows. typedef struct { OSMesgQueue *__mq; /* SI message queue */ int __channel; /* Controller port No. */ s32 __mode; /* Used within the OS */ u8 cmd_status; /* Command status */ } OSVoiceHandle; Do not change the values of these various members in the application. In addition, the only member variable which is referred to and which has any meaning is cmd_status. The member variables other than cmd_status are used by the system and therefore do not need to be referred to by the application. The member variable "cmd_status" indicates the voice recognition command status. When the voice recognition command status is checked within the osVoiceGetReadData() function�s voice recognition library, that value is kept in cmd_status. The following values can be handled by cmd_status. Please see the N64 Online Programming Manual, Section 26.8.4.2, "Status When Voice Recognition is Running," for details on each status.
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
See Also
|