mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2025-12-19 09:17:45 +00:00
elevenlabs to use http 1.1 (#57)
* elevenlabs to use http 1.1 Signed-off-by: Hoan HL <quan.luuhoang8@gmail.com> * update the rest of mod tts Signed-off-by: Hoan HL <quan.luuhoang8@gmail.com> * add env variable for disabling http2 Signed-off-by: Hoan HL <quan.luuhoang8@gmail.com> --------- Signed-off-by: Hoan HL <quan.luuhoang8@gmail.com>
This commit is contained in:
@@ -876,7 +876,10 @@ extern "C" {
|
||||
curl_easy_setopt(easy, CURLOPT_POSTFIELDS, conn->body);
|
||||
//curl_easy_setopt(easy, CURLOPT_POSTFIELDSIZE, body.length());
|
||||
|
||||
curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
// libcurl adding random byte to the response body that creates white noise to audio file
|
||||
// https://github.com/curl/curl/issues/10525
|
||||
const bool disable_http_2 = switch_true(std::getenv("DISABLE_HTTP2_FOR_TTS_STREAMING"));
|
||||
curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, disable_http_2 ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_2_0);
|
||||
|
||||
rc = curl_multi_add_handle(global.multi, conn->easy);
|
||||
mcode_test("new_conn: curl_multi_add_handle", rc);
|
||||
|
||||
Reference in New Issue
Block a user