void UnloadECI() { ttsTrace("ECI::Unload..."); // Free ECI if (eciInstance == NULL_ECI_HAND) return; eciDelete(eciInstance); eciInstance = NULL_ECI_HAND; //if (g_hinstLib != NULL) FreeLibrary(g_hinstLib); }
int main(int argc, char** argv) { uint8_t *buf; size_t len; { struct stat buf; while (!stat(TEST_DBG, &buf)) { sleep(1); } } ECIHand handle = eciNew(); if (!handle) return __LINE__; int fd = creat(PATHNAME_RAW_DATA, S_IRUSR|S_IWUSR); if (fd==-1) return __LINE__; eciRegisterCallback(handle, my_client_callback, (char*)NULL + fd); if (eciSetOutputBuffer(handle, MAX_SAMPLES, my_samples) == ECIFalse) return __LINE__; // eciSetOutputFilename(handle, PATHNAME_RAW_DATA); if (eciAddText(handle, vh_quote) == ECIFalse) return __LINE__; if (eciSynthesize(handle) == ECIFalse) return __LINE__; if (eciSynchronize(handle) == ECIFalse) return __LINE__; if (eciDelete(handle) != NULL) return __LINE__; exit0: return 0; }
int main(int argc, char **argv) { uint8_t *buf; size_t len; char version[20]; { struct stat buf; while (!stat(TEST_DBG, &buf)) { sleep(1); } } eciVersion(version); ECIHand handle = eciNew(); if (!handle) return __LINE__; int fd = creat(PATHNAME_RAW_DATA, S_IRUSR|S_IWUSR); if (fd==-1) return __LINE__; eciRegisterCallback(handle, my_client_callback, (char*)NULL + fd); if (eciSetOutputBuffer(handle, MAX_SAMPLES, my_samples) == ECIFalse) return __LINE__; // eciSetOutputFilename(handle, PATHNAME_RAW_DATA); if (eciAddText(handle, vh_quote) == ECIFalse) return __LINE__; if (eciSynthesize(handle) == ECIFalse) return __LINE__; #define ONE_MILLISECOND_IN_NANOSECOND 1000000 struct timespec req; req.tv_sec=0; req.tv_nsec=ONE_MILLISECOND_IN_NANOSECOND; while(eciSpeaking(handle) == ECIFalse) nanosleep(&req, NULL); int i=0; while((eciSpeaking(handle) == ECITrue) && (i<50)) { nanosleep(&req, NULL); i++; } if (eciStop(handle) == ECIFalse) { char error[256]; eciErrorMessage(handle, error); fprintf(stderr, "eciStop error=%s, status=0x%x\n", error, eciProgStatus(handle)); eciClearErrors(handle); eciErrorMessage(handle, error); } while(eciSpeaking(handle) == ECITrue) { nanosleep(&req, NULL); } if (eciDelete(handle) != NULL) return __LINE__; exit0: return 0; }