Speech-Recognizer-ViaVoice

 view release on metacpan or  search on metacpan

ViaVoice.xs  view on Meta::CPAN


/*	return value of 0 indicates success
 */
int connectEngine()
{
	SM_MSG msg;
	SmArg args[3];
	int rc;
	char buf[1024];

	setenv("SPCH_BIN", VVDIR "/bin", 1);
	sprintf(buf, "%s/viavoice/temp", getenv("HOME"));
	setenv("SPCH_TRN", buf, 1);
	setenv("SPCH_RO", VVDIR "/vocabs", 1);
	setenv("SPCH_LOC", "vl1", 1);
	setenv("SPCH_PATH", VVDIR "/vocabs/langs/" LOCALE "/pools", 1);
	sprintf(buf, "%s/viavoice", getenv("HOME"));
	setenv("SPCH_RW", buf, 1);
	sprintf(buf, "%s/viavoice/temp", getenv("HOME"));
	setenv("SPCH_RUN", buf, 1);
	sprintf(buf, "%s/viavoice/temp/tmp", getenv("HOME"));
	setenv("SPCH_DIR", buf, 1);

	rc = SmOpen(0, NULL);
	if (rc == SM_RC_OK) {
		SmSetArg(args[0], SmNrecognize, 1);
		SmSetArg(args[1], SmNexternalNotifier, NotifierCallback);
		rc = SmConnect(2, args, &msg);
	}

	return rc;
}



( run in 0.838 second using v1.01-cache-2.11-cpan-6aa56a78535 )