From f4d24f7eec8f29c640b908956dec24d9cf39f42e Mon Sep 17 00:00:00 2001 From: Mathieu Date: Tue, 14 Sep 2021 10:49:20 +0200 Subject: [PATCH] Added timeout for tts --- jarvis/utils/client_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis/utils/client_utils.py b/jarvis/utils/client_utils.py index bdff3d9..7c91809 100644 --- a/jarvis/utils/client_utils.py +++ b/jarvis/utils/client_utils.py @@ -26,7 +26,7 @@ def get_audio_from_sentence(sentence): # TODO : add support for external opentts server try: - response = requests.get('http://localhost:5500/api/tts', headers=headers, params=params) + response = requests.get('http://localhost:5500/api/tts', headers=headers, params=params, timeout=0.2) return response.content except requests.exceptions.ConnectionError: print("Error connecting to Open TTS server")