Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: increase HTTP stream timeout after send for TTS #367

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

stintel
Copy link
Collaborator

@stintel stintel commented Feb 26, 2024

In commit af99de4 ("audio: reduce HTTP Stream timeout to 2s") we changed the HTTP Stream timeout to 2s so we can indicate early when we're not able to connect to WIS.

Unfortunately ESP HTTP Client only has a single timeout value, and we now also abort the HTTP connection to WIS if TTS takes longer than 2s. We want to keep the timeout reasonably low, as having to wait for a TTS response for too long isn't great for UX, but 2s is too short for long TTS responses.

Leave the initial timeout at 2s, but increase it to 10s on the HTTP_STREAM_POST_REQUEST event, which happens after the HTTP client sent header and body to WIS, but before fetching the response.

In commit af99de4 ("audio: reduce HTTP Stream timeout to 2s") we
changed the HTTP Stream timeout to 2s so we can indicate early when
we're not able to connect to WIS.

Unfortunately ESP HTTP Client only has a single timeout value, and we
now also abort the HTTP connection to WIS if TTS takes longer than 2s.
We want to keep the timeout reasonably low, as having to wait for a
TTS response for too long isn't great for UX, but 2s is too short for
long TTS responses.

Leave the initial timeout at 2s, but increase it to 10s on the
HTTP_STREAM_POST_REQUEST event, which happens after the HTTP client sent
header and body to WIS, but before fetching the response.
@kristiankielhofner kristiankielhofner merged commit 324fb23 into main Feb 27, 2024
15 checks passed
@kristiankielhofner kristiankielhofner deleted the fix/http_stream_timeout branch February 27, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants