Compare commits

..

3 Commits

Author SHA1 Message Date
Dave Horton d6e246d84c fix: discard incoming binary or text frame if we are shutting down to avoid deadlock (#84) 2024-06-28 07:28:35 -04:00
Hoan Luu Huu de676ddc81 append null to ostringstream will make c_str return part of a string. (#83)
* append null to ostringstream will make c_str return part of a string.

* fixed review comment

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

* fixed review comment

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

* fixed review comment

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>

---------

Signed-off-by: Quan HL <quan.luuhoang8@gmail.com>
2024-06-28 07:08:40 -04:00
Dave Horton d41bd15816 enable audio logging if env AZURE_AUDIO_LOGGING is set (#78)
* enable audio logging if env AZURE_AUDIO_LOGGING is set

* wip
2024-06-25 20:58:28 -04:00
2 changed files with 11 additions and 10 deletions
+5
View File
@@ -141,6 +141,11 @@ int AudioPipe::lws_callback(struct lws *wsi,
return 0;
}
if (ap->m_state == LWS_CLIENT_DISCONNECTING) {
lwsl_notice("AudioPipe::lws_service_thread race condition: got incoming message while closing the connection.\n");
return 0;
}
if (lws_frame_is_binary(wsi)) {
if (ap->is_bidirectional_audio_stream()) {
ap->m_callback(ap->m_uuid.c_str(), ap->m_bugname.c_str(), AudioPipe::BINARY, NULL, (char *) in, len);
+6 -10
View File
@@ -382,22 +382,18 @@ private:
const char* endpoint = switch_channel_get_variable(channel, "AZURE_SERVICE_ENDPOINT");
const char* endpointId = switch_channel_get_variable(channel, "AZURE_SERVICE_ENDPOINT_ID");
configuration_stream <<
endpoint << ";" <<
endpointId << ";";
configuration_stream << (endpoint ? endpoint : "") << ";"
<< (endpointId ? endpointId : "") << ";";
if (switch_true(switch_channel_get_variable(channel, "AZURE_USE_OUTPUT_FORMAT_DETAILED"))) {
configuration_stream << "output_format_detailed;";
}
if (switch_true(switch_channel_get_variable(channel, "AZURE_AUDIO_LOGGING"))) {
configuration_stream << "audio_logging;";
}
if (nullptr != proxyIP && nullptr != proxyPort) {
configuration_stream <<
proxyIP << ";" <<
proxyPort << ";" <<
proxyUsername << ";" <<
proxyPassword << ";";
}
configuration_stream << (proxyIP ? proxyIP : "") << ";"
<< (proxyPort ? proxyPort : "") << ";"
<< (proxyUsername ? proxyUsername : "") << ";"
<< (proxyPassword ? proxyPassword : "") << ";";
const char* var;
if (var = switch_channel_get_variable(channel, "AZURE_SPEECH_ALTERNATIVE_LANGUAGE_CODES")) {
configuration_stream << var << ";";