]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make mac like cepstral
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Mar 2006 21:05:07 +0000 (21:05 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Mar 2006 21:05:07 +0000 (21:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@734 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/include/switch_module_interfaces.h
src/mod/asr_tts/mod_cepstral/Makefile
src/mod/asr_tts/mod_cepstral/mod_cepstral.c
src/switch_core.c
src/switch_ivr.c

index b02ef61d0fd3638b4445c5ac3069f10db9363277..35ec99a5e2c77bf7e3a2a81721ceca6c4c5f946f 100644 (file)
@@ -778,7 +778,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
                                                                                                          char *module_name,
                                                                                                          char *voice_name,
                                                                                                          unsigned int rate,
-                                                                                                         switch_speech_flag flags,
+                                                                                                         switch_speech_flag *flags,
                                                                                                          switch_memory_pool *pool);
 
 /*!
index a8ea0d1819e18d5dfc12e98f22c5875eed16a465..93bfd4a1f7b3a4b67a2e5628d1f8a1b90393de7f 100644 (file)
@@ -291,8 +291,8 @@ struct switch_speech_interface {
        /*! 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*/
index 1fe26e8624fd1968eb52e680f88efe3758bcd00b..11ce6d0b72a72d2fb4768463a47a51310c3ac3dd 100644 (file)
@@ -1,7 +1,12 @@
+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
 
index 278194835b233e2eaa290e3d5ee8e6fe0843682a..de3b5e6c2b39e4f72419290b82acd2ded126a6f8 100644 (file)
@@ -75,12 +75,12 @@ static swift_result_t write_audio(swift_event *event, swift_event_t type, void *
     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];
 
@@ -175,8 +175,8 @@ static switch_status cepstral_speech_feed_tts(switch_speech_handle *sh, char *te
 
 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;
@@ -253,7 +253,7 @@ const switch_speech_interface cepstral_speech_interface = {
        
 };
 
-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,
index d95e57e61a6804b958a9235400c8bfdd1ca031d1..4e0931fd7ad8e5a40e39b5d1c1ece9e6a79947b0 100644 (file)
@@ -481,7 +481,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
                                                                                                          char *module_name, 
                                                                                                          char *voice_name,
                                                                                                          unsigned int rate,
-                                                                                                         switch_speech_flag flags,
+                                                                                                         switch_speech_flag *flags,
                                                                                                          switch_memory_pool *pool)
 {
        switch_status status;
@@ -491,7 +491,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
                return SWITCH_STATUS_GENERR;
        }
 
-       sh->flags = flags;
+       sh->flags = *flags;
        if (pool) {
                sh->memory_pool = pool;
        } else {
@@ -514,7 +514,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_feed_asr(switch_speech_handle *
 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);
 }
 
index bba651022a05302618a8a658b7978e2d546bd491..763b74bd1c16af75ae1d7c609b9d204ae35927b5 100644 (file)
@@ -513,7 +513,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
                                                                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;