diff --git a/mod_audio_fork/Makefile.am b/mod_audio_fork/Makefile.am index 0da48c9..fc0cad5 100644 --- a/mod_audio_fork/Makefile.am +++ b/mod_audio_fork/Makefile.am @@ -15,4 +15,4 @@ endif endif mod_audio_fork_la_LIBADD = $(switch_builddir)/libfreeswitch.la -mod_audio_fork_la_LDFLAGS = -avoid-version -module -no-undefined -shared `pkg-config --libs libwebsockets` -lstdc++ +mod_audio_fork_la_LDFLAGS = -avoid-version -module -no-undefined -shared `pkg-config --libs libwebsockets` -lstdc++ -lboost_system -lboost_thread diff --git a/mod_audio_fork/vector_math.cpp b/mod_audio_fork/vector_math.cpp index 9086710..4481ebb 100644 --- a/mod_audio_fork/vector_math.cpp +++ b/mod_audio_fork/vector_math.cpp @@ -1,6 +1,7 @@ #include "vector_math.h" #include #include +#include #define GRANULAR_VOLUME_MAX (50) #define SMAX 32767 @@ -153,6 +154,7 @@ typedef union { } vector_data_t; #else +#pragma message("Building without vector math support") void vector_add(int16_t* a, int16_t* b, size_t len) { for (size_t i = 0; i < len; i++) { a[i] += b[i]; diff --git a/mod_azure_tts/azure_glue.cpp b/mod_azure_tts/azure_glue.cpp index 8bdd521..2b885a3 100644 --- a/mod_azure_tts/azure_glue.cpp +++ b/mod_azure_tts/azure_glue.cpp @@ -158,7 +158,7 @@ extern "C" { CircularBuffer_t *cBuffer = (CircularBuffer_t *) a->circularBuffer; std::vector pcm_data; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Synthesizing: received data\n"); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Synthesizing: received data\n"); if (a->flushed) { return; @@ -204,6 +204,7 @@ extern "C" { switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_PLAYBACK_START) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Playback-File-Type", "tts_stream"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "variable_tts_time_to_first_byte_ms", time_to_first_byte_ms.c_str()); if (a->cache_filename) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "variable_tts_cache_filename", a->cache_filename); @@ -314,7 +315,7 @@ extern "C" { a->flushed = 1; if (!download_complete) { if (a->file) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "closing audio cache file %s because download was interrupted\n", a->cache_filename); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "closing audio cache file %s because download was interrupted\n", a->cache_filename); if (fclose(a->file) != 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error closing audio cache file\n"); } @@ -322,7 +323,7 @@ extern "C" { } if (a->cache_filename) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "removing audio cache file %s because download was interrupted\n", a->cache_filename); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "removing audio cache file %s because download was interrupted\n", a->cache_filename); if (unlink(a->cache_filename) != 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cleanupConn: error removing audio cache file %s: %d:%s\n", a->cache_filename, errno, strerror(errno)); diff --git a/mod_azure_tts/mod_azure_tts.c b/mod_azure_tts/mod_azure_tts.c index 2df0085..26a6c45 100644 --- a/mod_azure_tts/mod_azure_tts.c +++ b/mod_azure_tts/mod_azure_tts.c @@ -6,7 +6,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_azure_tts_shutdown); SWITCH_MODULE_DEFINITION(mod_azure_tts, mod_azure_tts_load, mod_azure_tts_shutdown, NULL); static void clearAzure(azure_t* a, int freeAll) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "clearAzure\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "clearAzure\n"); if (a->cache_filename) free(a->cache_filename); if (a->api_key) free(a->api_key); @@ -46,7 +46,7 @@ static azure_t * createOrRetrievePrivateData(switch_speech_handle_t *sh) { sh->private_info = a; memset(a, 0, sizeof(*a)); switch_mutex_init(&a->mutex, SWITCH_MUTEX_NESTED, sh->memory_pool); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "allocated azure_t\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "allocated azure_t\n"); } return a; } @@ -56,7 +56,7 @@ switch_status_t a_speech_open(switch_speech_handle_t *sh, const char *voice_name azure_t *a = createOrRetrievePrivateData(sh); a->voice_name = strdup(voice_name); a->rate = rate; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a_speech_open voice: %s, rate %d, channels %d\n", voice_name, rate, channels); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "a_speech_open voice: %s, rate %d, channels %d\n", voice_name, rate, channels); return azure_speech_open(a); } @@ -64,7 +64,7 @@ static switch_status_t a_speech_close(switch_speech_handle_t *sh, switch_speech_ { switch_status_t rc; azure_t *a = createOrRetrievePrivateData(sh); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a_speech_close\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "a_speech_close\n"); switch_mutex_destroy(a->mutex); @@ -84,8 +84,6 @@ static switch_status_t a_speech_feed_tts(switch_speech_handle_t *sh, char *text, a->flushed = 0; a->samples_rate = 0; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a_speech_feed_tts\n"); - return azure_speech_feed_tts(a, text, flags); } @@ -95,7 +93,6 @@ static switch_status_t a_speech_feed_tts(switch_speech_handle_t *sh, char *text, static switch_status_t a_speech_read_tts(switch_speech_handle_t *sh, void *data, size_t *datalen, switch_speech_flag_t *flags) { azure_t *a = createOrRetrievePrivateData(sh); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a_speech_read_tts\n"); return azure_speech_read_tts(a, data, datalen, flags); } @@ -105,7 +102,6 @@ static switch_status_t a_speech_read_tts(switch_speech_handle_t *sh, void *data, static void a_speech_flush_tts(switch_speech_handle_t *sh) { azure_t *a = createOrRetrievePrivateData(sh); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "w_speech_flush_tts\n"); azure_speech_flush_tts(a); clearAzure(a, 0); @@ -114,7 +110,7 @@ static void a_speech_flush_tts(switch_speech_handle_t *sh) static void a_text_param_tts(switch_speech_handle_t *sh, char *param, const char *val) { azure_t *a = createOrRetrievePrivateData(sh); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a_text_param_tts: %s=%s\n", param, val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "a_text_param_tts: %s=%s\n", param, val); if (0 == strcmp(param, "api_key")) { if (a->api_key) free(a->api_key); a->api_key = strdup(val); diff --git a/mod_dub/Makefile.am b/mod_dub/Makefile.am index 21dd41d..c5b46ae 100644 --- a/mod_dub/Makefile.am +++ b/mod_dub/Makefile.am @@ -15,4 +15,4 @@ endif endif mod_dub_la_LIBADD = $(switch_builddir)/libfreeswitch.la -mod_dub_la_LDFLAGS = -avoid-version -module -no-undefined -shared `pkg-config --libs boost` -lstdc++ -lmpg123 +mod_dub_la_LDFLAGS = -avoid-version -module -no-undefined -lstdc++ -lmpg123 -lboost_system -lboost_thread diff --git a/mod_dub/vector_math.cpp b/mod_dub/vector_math.cpp index 9086710..be8e30b 100644 --- a/mod_dub/vector_math.cpp +++ b/mod_dub/vector_math.cpp @@ -1,6 +1,8 @@ #include "vector_math.h" #include #include +#include + #define GRANULAR_VOLUME_MAX (50) #define SMAX 32767 @@ -153,6 +155,7 @@ typedef union { } vector_data_t; #else +#pragma message("Building without vector math support") void vector_add(int16_t* a, int16_t* b, size_t len) { for (size_t i = 0; i < len; i++) { a[i] += b[i];