File freeswitch-1.0.4_mod_cepstral_cache.diff of Package freeswitch

diff -urN src/mod/asr_tts/mod_cepstral_cache--/Makefile src/mod/asr_tts/mod_cepstral_cache/Makefile
--- src/mod/asr_tts/mod_cepstral_cache--/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ src/mod/asr_tts/mod_cepstral_cache/Makefile	2009-09-22 17:37:58.594266637 +0200
@@ -0,0 +1,6 @@
+LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-L$(SWIFT_HOME)/lib -L/opt/swift/lib -lswift -lm" ; fi ;
+
+LOCAL_INSERT_CFLAGS=test $$osarch = "Darwin" || echo "-I$(SWIFT_HOME)/include -I/opt/swift/include";
+LOCAL_CFLAGS=-w
+include ../../../../build/modmake.rules
+
diff -urN src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.2008.vcproj src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.2008.vcproj
--- src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.2008.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.2008.vcproj	2009-09-22 17:37:58.594266637 +0200
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="mod_cepstral"
+	ProjectGUID="{692F6330-4D87-4C82-81DF-40DB5892636E}"
+	RootNamespace="mod_cepstral"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			ConfigurationType="2"
+			InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;C:\Program Files\Cepstral\sdk\include&quot;"
+				UsePrecompiledHeader="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="swift.lib"
+				AdditionalLibraryDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;;&quot;C:\Program Files\Cepstral\sdk\lib\windows&quot;"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			ConfigurationType="2"
+			InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;C:\Program Files\Cepstral\sdk\include&quot;"
+				UsePrecompiledHeader="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="swift.lib"
+				AdditionalLibraryDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;;&quot;C:\Program Files\Cepstral\sdk\lib\windows&quot;"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\mod_cepstral.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff -urN src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.c src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.c
--- src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.c	1970-01-01 01:00:00.000000000 +0100
+++ src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.c	2010-02-10 14:49:28.189070578 +0100
@@ -0,0 +1,514 @@
+/*
+ * Contributor(s):
+ * 
+ * Lele Forzani <lele@windmill.it>
+ *
+ *
+ * mod_cepstral_cache.c -- Cepstral Interface with sentence cache
+ * 
+ * Contains some material derived from the Cepstral Swift SDK, by  
+ * permission.  You are free to copy and modify the source under the  
+ * terms of FreeSWITCH itself, without additional permission from  
+ * Cepstral
+ * 
+ *
+ */
+
+
+#ifdef __ICC
+#pragma warning (disable:188)
+#endif
+#ifdef MACOSX
+#include <swift/swift.h>
+#else
+#include <swift.h>
+#endif
+#include <switch.h>
+
+#define MY_BUF_LEN 1024 * 32
+#define MY_BLOCK_SIZE MY_BUF_LEN
+
+#undef SWIFT_FAILED
+#define SWIFT_FAILED(r) ((void *)(r) < (void *)0)
+
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_cache_load);
+SWITCH_MODULE_DEFINITION_EX(mod_cepstral_cache, mod_cepstral_cache_load, NULL, NULL, SMODF_GLOBAL_SYMBOLS);
+
+static swift_engine *engine;
+
+
+typedef struct {
+	swift_background_t tts_stream;
+	swift_port *port;
+	int rate;
+	swift_params *params;
+	swift_voice *voice;
+	char *voice_name;
+	switch_mutex_t *audio_lock;
+	switch_buffer_t *audio_buffer;
+	switch_file_handle_t fh;
+	int16_t *file_audio_data; 
+
+	int cached;
+	int done;
+	int done_gen;
+} cepstral_cache_t;
+
+
+
+/* This callback caches the audio in the buffer */
+static swift_result_t write_audio(swift_event * event, swift_event_t type, void *udata)
+{
+	cepstral_cache_t *cepstral;
+	swift_event_t rv = SWIFT_SUCCESS;
+	void *buf = NULL;
+	int len = 0, i = 0;
+	cepstral = udata;
+	assert(cepstral != NULL);
+
+	if (!cepstral->port || cepstral->done || cepstral->done_gen) {
+		return SWIFT_UNKNOWN_ERROR;
+	}
+
+	/* Only proceed when we have success */
+	if (!SWIFT_FAILED((rv = swift_event_get_audio(event, &buf, &len)))) {
+		while (!cepstral->done) {
+			switch_mutex_lock(cepstral->audio_lock);
+			if (switch_buffer_write(cepstral->audio_buffer, buf, len) > 0) {
+				switch_mutex_unlock(cepstral->audio_lock);
+				break;
+			}
+			switch_mutex_unlock(cepstral->audio_lock);
+			if (!cepstral->done) {
+				for (i = 0; i < 10; i++) {
+					switch_yield(10000);
+					if (cepstral->done) {
+						break;
+					}
+				}
+			}
+
+		}
+	} else {
+		cepstral->done = 1;
+	}
+
+	if (cepstral->done) {
+		rv = SWIFT_UNKNOWN_ERROR;
+	}
+
+	return rv;
+}
+
+
+static switch_status_t cepstral_cache_speech_open(switch_speech_handle_t *sh, const char *voice_name, int rate, switch_speech_flag_t *flags)
+{
+	cepstral_cache_t *cepstral = switch_core_alloc(sh->memory_pool, sizeof(*cepstral));
+
+	if (!cepstral) {
+		return SWITCH_STATUS_MEMERR;
+	}
+
+	cepstral->voice_name = voice_name;
+	cepstral->rate = rate;
+	switch_mutex_init(&cepstral->audio_lock, SWITCH_MUTEX_NESTED, sh->memory_pool); 
+
+	if (switch_buffer_create_dynamic(&cepstral->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
+		return SWITCH_STATUS_MEMERR;
+	}
+
+	sh->private_info = cepstral;
+	return SWITCH_STATUS_SUCCESS;
+
+  all_done:
+	return SWITCH_STATUS_FALSE;
+}
+
+static switch_status_t cepstral_cache_speech_close(switch_speech_handle_t *sh, switch_speech_flag_t *flags)
+{
+
+	cepstral_cache_t *cepstral;
+
+	assert(sh != NULL);
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	cepstral->done = 1;
+	cepstral->done_gen = 1;
+	swift_port_stop(cepstral->port, SWIFT_ASYNC_ANY, SWIFT_EVENT_NOW);
+	/* Close the Swift Port and Engine */
+	if (NULL != cepstral->port)
+		swift_port_close(cepstral->port);
+	//if (NULL != cepstral->engine) swift_engine_close(cepstral->engine);
+
+	cepstral->port = NULL;
+	//cepstral->engine = NULL;
+
+	switch_buffer_destroy(&cepstral->audio_buffer);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t cepstral_cache_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
+{
+	cepstral_cache_t *cepstral;
+	const char *fp = "file:";
+	const char *encoding = "utf-8";
+	switch_file_handle_t fh = { 0 };
+	char *file;
+	int len = (int) strlen(fp);
+	char srate[25];
+
+	assert(sh != NULL);
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	cepstral->done_gen = 0;
+	cepstral->done = 0;
+	cepstral->cached = 0;
+
+	cepstral->tts_stream = NULL;
+
+	if (switch_strlen_zero(text)) {
+		return SWITCH_STATUS_FALSE;
+	}
+
+	char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 };
+	char *dbuf = switch_mprintf("%s:%s", cepstral->voice, text);
+	switch_md5_string(digest, (void *) dbuf, strlen(dbuf));
+	switch_safe_free(dbuf);
+
+	file = switch_mprintf("%s%s%s%s%s.wav", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR, "tts_cache", SWITCH_PATH_SEPARATOR, digest);
+
+	/* if we need to generate file */
+	if (switch_core_file_open(&cepstral->fh,
+							  file,
+							  1,
+							  cepstral->rate,
+							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS) {
+		
+		cepstral->cached = 1;
+		
+		uint32_t pos = 0;
+		switch_core_file_seek(&cepstral->fh, &pos, 0, SEEK_SET);
+		switch_zmalloc(cepstral->file_audio_data,  MY_BUF_LEN * sizeof(*cepstral->file_audio_data));
+
+	} else {
+
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sentence file '%s' not found in cache. Generating.\n", file);
+
+		cepstral->params = swift_params_new(NULL);
+		swift_params_set_string(cepstral->params, "audio/encoding", "pcm16");
+		switch_snprintf(srate, sizeof(srate), "%d", cepstral->rate);
+		swift_params_set_string(cepstral->params, "audio/sampling-rate", srate);
+
+		swift_params_set_string(cepstral->params, "audio/output-file", file);
+		swift_params_set_string(cepstral->params, "audio/output-format", "riff");
+
+		/* Open a Swift Port through which to make TTS calls */
+		if (SWIFT_FAILED(cepstral->port = swift_port_open(engine, cepstral->params))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open Swift Port.\n");
+			goto all_done;
+		}
+	
+		if (cepstral->voice_name && SWIFT_FAILED(swift_port_set_voice_by_name(cepstral->port, cepstral->voice_name))) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid voice %s!\n", cepstral->voice_name);
+			cepstral->voice_name = NULL;
+		}
+
+		if (switch_strlen_zero(cepstral->voice_name)) {
+			/* Find the first voice on the system */
+			if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n");
+				goto all_done;
+			}
+
+			/* Set the voice found by find_first_voice() as the port's current voice */
+			if (SWIFT_FAILED(swift_port_set_voice(cepstral->port, cepstral->voice))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set voice.\n");
+				goto all_done;
+			}
+
+			cepstral->voice_name = (char *) swift_voice_get_attribute(cepstral->voice, "name");
+		}
+
+		if (cepstral->voice_name) {
+			switch_copy_string(sh->voice, cepstral->voice_name, sizeof(sh->voice));
+		}
+
+		swift_port_set_callback(cepstral->port, &write_audio, SWIFT_EVENT_AUDIO, cepstral);
+
+		if (!strncasecmp(text, fp, len)) {
+			text += len;
+			if (switch_strlen_zero(text)) {
+				return SWITCH_STATUS_FALSE;
+			}
+			swift_port_speak_file(cepstral->port, text, encoding, &cepstral->tts_stream, NULL);
+		} else {
+			char *to_say;
+			if (switch_strlen_zero(text)) {
+				return SWITCH_STATUS_FALSE;
+			}
+
+			if ((to_say = switch_mprintf("<break time=\"1000ms\"/> %s <break time=\"1000ms\"/>", text))) {
+				swift_port_speak_text(cepstral->port, to_say, 0, encoding, &cepstral->tts_stream, NULL);
+				switch_safe_free(to_say);
+			}
+		}
+	}
+
+	switch_safe_free(file);
+	return SWITCH_STATUS_FALSE;
+
+all_done:
+
+	switch_safe_free(file);
+	return SWITCH_STATUS_FALSE;
+
+}
+
+static void cepstral_cache_speech_flush_tts(switch_speech_handle_t *sh)
+{
+	cepstral_cache_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	cepstral->done_gen = 1;
+	cepstral->done = 1;
+	if (cepstral->audio_buffer) {
+		switch_mutex_lock(cepstral->audio_lock);
+		switch_buffer_zero(cepstral->audio_buffer);
+		switch_mutex_unlock(cepstral->audio_lock);
+	}
+	switch_safe_free(cepstral->file_audio_data);
+	swift_port_stop(cepstral->port, SWIFT_ASYNC_ANY, SWIFT_EVENT_NOW);
+
+	if((cepstral->cached) && (cepstral->fh.file_interface != NULL))
+		switch_core_file_close(&cepstral->fh);
+}
+
+static switch_status_t cepstral_cache_speech_read_tts(switch_speech_handle_t *sh, void *data, size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags)
+{
+	cepstral_cache_t *cepstral;
+	size_t desired = *datalen;
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	size_t used, padding = 0;
+	int16_t *audio_buffer = NULL;
+
+	assert(sh != NULL);
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+	
+	if(cepstral->cached) {
+
+		/* we have cached data */
+		if(cepstral->fh.file_interface == NULL)
+			return SWITCH_STATUS_FALSE;
+
+		switch_mutex_lock(cepstral->audio_lock);
+		used = switch_buffer_inuse(cepstral->audio_buffer);
+
+		if((!cepstral->done_gen) && (used <= MY_BUF_LEN)) {
+
+			size_t samples = MY_BUF_LEN/2; // - used;			
+	
+			if ((switch_core_file_read(&cepstral->fh, cepstral->file_audio_data, &samples) != SWITCH_STATUS_SUCCESS) || (samples <= 0)) {
+				cepstral->done_gen++;
+			} else {
+				switch_buffer_write(cepstral->audio_buffer, cepstral->file_audio_data, samples*2);
+			}			
+		}
+		switch_mutex_unlock(cepstral->audio_lock);	
+
+
+		switch_mutex_lock(cepstral->audio_lock);
+		used = switch_buffer_inuse(cepstral->audio_buffer);
+
+		if (!used && cepstral->done_gen) {
+			status = SWITCH_STATUS_BREAK;
+		} else {
+			*datalen = switch_buffer_read(cepstral->audio_buffer, data, desired);
+			status = SWITCH_STATUS_SUCCESS;
+		}
+		switch_mutex_unlock(cepstral->audio_lock);
+
+	} else {
+		/* we have original data */
+
+		while (!cepstral->done) {
+			if (!cepstral->done_gen) {
+				int check = swift_port_status(cepstral->port, cepstral->tts_stream);
+
+				if (!check == SWIFT_STATUS_RUNNING) {
+					cepstral->done_gen = 1;
+				}
+			}
+
+			switch_mutex_lock(cepstral->audio_lock);
+			used = switch_buffer_inuse(cepstral->audio_buffer);
+			switch_mutex_unlock(cepstral->audio_lock);
+
+			if (!used && cepstral->done_gen) {
+
+				status = SWITCH_STATUS_BREAK;
+				break;
+			}
+
+			/* wait for the right amount of data (unless there is no blocking flag) */
+			if (used < desired) {
+				if (cepstral->done_gen) {
+					padding = desired - used;
+					desired = used;
+				}
+				if (!(*flags & SWITCH_SPEECH_FLAG_BLOCKING)) {
+					*datalen = 0;
+					status = SWITCH_STATUS_SUCCESS;
+					break;
+				}
+				switch_yield(1000);
+				continue;
+			}
+
+			/* There is enough, read it and return */
+			switch_mutex_lock(cepstral->audio_lock);
+			*datalen = switch_buffer_read(cepstral->audio_buffer, data, desired);
+			if (padding) {
+				size_t x = 0;
+				unsigned char *p = data;
+
+				for (x = 0; x < padding; x++) {
+					*(p + x) = 0;
+					(*datalen)++;
+				}
+			}
+
+			switch_mutex_unlock(cepstral->audio_lock);
+			status = SWITCH_STATUS_SUCCESS;
+
+			break;
+		}
+	}
+	return status;
+}
+
+
+static void cepstral_cache_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val)
+{
+	cepstral_cache_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	if (!strcasecmp(param, "voice")) {
+		const char *voice_name = val;
+		if (!strcasecmp(voice_name, "next")) {
+			if ((cepstral->voice = swift_port_find_next_voice(cepstral->port))) {
+				if (SWIFT_FAILED(swift_port_set_voice(cepstral->port, cepstral->voice))) {
+					cepstral->done = cepstral->done_gen = 1;
+					return;
+				}
+				voice_name = swift_voice_get_attribute(cepstral->voice, "name");
+			} else {
+				voice_name = NULL;
+			}
+		} else {
+			if (voice_name && SWIFT_FAILED(swift_port_set_voice_by_name(cepstral->port, voice_name))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid voice %s!\n", voice_name);
+				voice_name = NULL;
+			}
+		}
+
+		if (!voice_name) {
+			/* Find the first voice on the system */
+			if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n");
+				cepstral->done = cepstral->done_gen = 1;
+				return;
+			}
+
+			/* Set the voice found by find_first_voice() as the port's current voice */
+			if (SWIFT_FAILED(swift_port_set_voice(cepstral->port, cepstral->voice))) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to set voice.\n");
+				cepstral->done = cepstral->done_gen = 1;
+				return;
+			}
+
+			voice_name = swift_voice_get_attribute(cepstral->voice, "name");
+		}
+
+		if (voice_name) {
+			switch_copy_string(sh->voice, voice_name, sizeof(sh->voice));
+		}
+
+		return;
+	}
+
+	swift_port_set_param_string(cepstral->port, param, val, NULL);
+}
+
+static void cepstral_cache_numeric_param_tts(switch_speech_handle_t *sh, char *param, int val)
+{
+	cepstral_cache_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	swift_port_set_param_int(cepstral->port, param, val, NULL);
+
+}
+
+
+static void cepstral_cache_float_param_tts(switch_speech_handle_t *sh, char *param, double val)
+{
+	cepstral_cache_t *cepstral;
+
+	cepstral = sh->private_info;
+	assert(cepstral != NULL);
+
+	swift_port_set_param_float(cepstral->port, param, val, NULL);
+
+}
+
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_cache_load)
+{
+	switch_speech_interface_t *speech_interface;
+
+	/* Open the Swift TTS Engine */
+/*	if (SWIFT_FAILED(engine = swift_engine_open(NULL))) {*/
+	if (!(engine = swift_engine_open(NULL))) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open Swift Engine.");
+		return SWITCH_STATUS_GENERR;
+	}
+
+	/* connect my internal structure to the blank pointer passed to me */
+	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+	speech_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_SPEECH_INTERFACE);
+	speech_interface->interface_name = "cepstral_cache";
+	speech_interface->speech_open = cepstral_cache_speech_open;
+	speech_interface->speech_close = cepstral_cache_speech_close;
+	speech_interface->speech_feed_tts = cepstral_cache_speech_feed_tts;
+	speech_interface->speech_read_tts = cepstral_cache_speech_read_tts;
+	speech_interface->speech_flush_tts = cepstral_cache_speech_flush_tts;
+	speech_interface->speech_text_param_tts = cepstral_cache_text_param_tts;
+	speech_interface->speech_numeric_param_tts = cepstral_cache_numeric_param_tts;
+	speech_interface->speech_float_param_tts = cepstral_cache_float_param_tts;
+
+	/* indicate that the module should continue to be loaded */
+	return SWITCH_STATUS_SUCCESS;
+}
+
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
diff -urN src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.vcproj src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.vcproj
--- src/mod/asr_tts/mod_cepstral_cache--/mod_cepstral_cache.vcproj	1970-01-01 01:00:00.000000000 +0100
+++ src/mod/asr_tts/mod_cepstral_cache/mod_cepstral_cache.vcproj	2009-09-22 17:37:58.594266637 +0200
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="mod_cepstral"
+	ProjectGUID="{692F6330-4D87-4C82-81DF-40DB5892636E}"
+	RootNamespace="mod_cepstral"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			ConfigurationType="2"
+			InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;;&quot;C:\Program Files\Cepstral\sdk\lib\windows&quot;"
+				UsePrecompiledHeader="0"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="swift.lib"
+				AdditionalLibraryDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			ConfigurationType="2"
+			InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;;&quot;C:\Program Files\Cepstral\sdk\lib\windows&quot;"
+				UsePrecompiledHeader="0"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="swift.lib"
+				AdditionalLibraryDirectories="&quot;C:\Program Files\Cepstral\sdk\lib\winnt&quot;"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\mod_cepstral.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
openSUSE Build Service is sponsored by