87{
91
92
94
95
96 strcpy(
mtTalkStr,
"\\Windows\\Media\\notify.wav");
97 strcpy(
mtUserStr,
"\\Windows\\Media\\notify.wav");
98
99
100 for (
i = 1;
i < argc;
i++) {
101 if (argv[
i][0] ==
'-') {
102 if (
i + 1 >= argc || argv[
i + 1][0] ==
'-')
104 if (argv[
i][1] ==
'e')
106 else if (argv[
i][1] ==
'h')
108 else if (argv[
i][1] ==
't')
110 else if (argv[
i][1] ==
'u')
112 else if (argv[
i][1] ==
's')
114 else {
116 printf("usage: mspeaker [-h <hostname>] [-e <experiment>]\n\n");
117 printf(" [-t <file>] Specify the alert wave file for MT_TALK messages\n");
118 printf(" [-u <file>] Specify the alert wave file for MT_USER messages\n");
119 printf(" [-s <sec>] Specify the min time interval between alert [s]\n");
120 return 0;
121 }
122 }
123 }
124
125
126 CoInitialize ( NULL );
127
128
129 CoCreateInstance ( CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (
void**)&
Voice );
131 printf("Cannot initialize speech system\n");
132 return 1;
133 }
134
135 reconnect:
136
137
140 return 1;
141
143
144
146
147 printf("Midas Message Talker connected to %s. Press \"!\" to exit\n",
149
150 do {
153 ch = getch();
154 if (ch == 'r')
156 if (ch == '!')
157 break;
158 }
159
162 printf("Trying to reconnect...\n");
164 goto reconnect;
165 }
166
168
169
172
173
174 CoUninitialize();
175
177 return 1;
178}
INT cm_yield(INT millisec)
INT cm_connect_experiment(const char *host_name, const char *exp_name, const char *client_name, void(*func)(char *))
INT cm_disconnect_experiment(void)
INT cm_get_environment(char *host_name, int host_name_size, char *exp_name, int exp_name_size)
INT cm_set_watchdog_params(BOOL call_watchdog, DWORD timeout)
INT ss_sleep(INT millisec)
INT cm_msg_register(EVENT_HANDLER *func)
char exp_name[NAME_LENGTH]
char host_name[HOST_NAME_LENGTH]
void receive_message(HNDLE hBuf, HNDLE id, EVENT_HEADER *header, void *message)