Added timeout for tts
This commit is contained in:
parent
6284b7c2ab
commit
f4d24f7eec
@ -26,7 +26,7 @@ def get_audio_from_sentence(sentence):
|
|||||||
|
|
||||||
# TODO : add support for external opentts server
|
# TODO : add support for external opentts server
|
||||||
try:
|
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
|
return response.content
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
print("Error connecting to Open TTS server")
|
print("Error connecting to Open TTS server")
|
||||||
|
Reference in New Issue
Block a user