char *module_name,
char *voice_name,
unsigned int rate,
- switch_speech_flag flags,
+ switch_speech_flag *flags,
switch_memory_pool *pool);
/*!
/*! function to open the speech interface */
switch_status (*speech_open)(switch_speech_handle *sh,
char *voice_name,
- unsigned int rate,
- switch_speech_flag flags);
+ int rate,
+ switch_speech_flag *flags);
/*! function to close the speech interface */
switch_status (*speech_close)(switch_speech_handle *, switch_speech_flag *flags);
/*! function to feed audio to the ASR*/
+ifeq ($(OSARCH),Darwin)
+CFLAGS += -I/Library/Frameworks/swift.framework/Versions/4/Headers
+LDFLAGS += -framework swift -lm
+else
LDFLAGS += -L/opt/swift/lib -lswift -lceplex_us -lceplang_en -lceplang_de -lceplang_es -lceplang_fr -lceplang_it -lm
CFLAGS += -I/opt/swift/include
-LINKER=$(CC)
+endif
+LINKER=$(CC)
all: depends $(MODNAME).so
return rv;
}
-static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, unsigned int rate, switch_speech_flag flags)
+static switch_status cepstral_speech_open(switch_speech_handle *sh, char *voice_name, int rate, switch_speech_flag *flags)
{
- if (flags & SWITCH_SPEECH_FLAG_ASR) {
+ if (*flags & SWITCH_SPEECH_FLAG_ASR) {
return SWITCH_STATUS_FALSE;
}
- if (flags & SWITCH_SPEECH_FLAG_TTS) {
+ if (*flags & SWITCH_SPEECH_FLAG_TTS) {
cepstral_t *cepstral = switch_core_alloc(sh->memory_pool, sizeof(*cepstral));
char srate[25];
static switch_status cepstral_speech_read_tts(switch_speech_handle *sh,
void *data,
- unsigned int *datalen,
- unsigned int *rate,
+ size_t *datalen,
+ size_t *rate,
switch_speech_flag *flags)
{
cepstral_t *cepstral;
};
-static switch_loadable_module_interface cepstral_module_interface = {
+const switch_loadable_module_interface cepstral_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ NULL,
char *module_name,
char *voice_name,
unsigned int rate,
- switch_speech_flag flags,
+ switch_speech_flag *flags,
switch_memory_pool *pool)
{
switch_status status;
return SWITCH_STATUS_GENERR;
}
- sh->flags = flags;
+ sh->flags = *flags;
if (pool) {
sh->memory_pool = pool;
} else {
SWITCH_DECLARE(switch_status) switch_core_speech_interpret_asr(switch_speech_handle *sh, char *buf, unsigned int buflen, switch_speech_flag *flags)
{
assert(sh != NULL);
-
+
return sh->speech_interface->speech_interpret_asr(sh, buf, buflen, flags);
}
tts_name,
voice_name,
(unsigned int)rate,
- flags,
+ &flags,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Invalid TTS module!\n");
return SWITCH_STATUS_FALSE;