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

SDK should include a custom timeout configuration #2338

Closed
v-leichen1 opened this issue Apr 12, 2024 · 3 comments
Closed

SDK should include a custom timeout configuration #2338

v-leichen1 opened this issue Apr 12, 2024 · 3 comments
Labels
accepted Issue moved to product team backlog. Will be closed when addressed. update needed For items that are in progress but have not been updated

Comments

@v-leichen1
Copy link

Is your feature request related to a problem? Please describe.
Customers have reported an issue related to the code in the following GitHub link:
https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/java/jre/console/src/com/microsoft/cognitiveservices/speech/samples/console/SpeechSynthesisScenarioSamples.java

Specifically, when the Speech service is unavailable (503 status) or the execution time is too long, the method audioDataStream.readData(buffer) on line 111 often hangs. This prevents subsequent tasks from proceeding, causing the application to wait indefinitely for the SDK to cancel the task.

Describe the solution you'd like
To enhance the robustness of our application, we recommend that the SDK include settings to configure timeouts.

Describe alternatives you've considered
While timeouts can be managed at the application level using Java's "ExecutorService" and "Future", incorporating this feature directly into the SDK would simplify management and improve usability.

@ralph-msft ralph-msft self-assigned this Apr 22, 2024
@ralph-msft ralph-msft added the accepted Issue moved to product team backlog. Will be closed when addressed. label Apr 22, 2024
@ralph-msft
Copy link

ralph-msft commented Apr 22, 2024

You should always check the SpeechSynthesisResult.getReason() value. If this is anything other than SynthesizingAudioStarted you should not attempt to read from the audio stream.

I will file a task to update our sample code to add this check.

B-7129855

@ralph-msft ralph-msft removed their assignment Apr 22, 2024
Copy link

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.

@github-actions github-actions bot added the update needed For items that are in progress but have not been updated label May 13, 2024
@pankopon
Copy link
Contributor

Closed as the requested control can be already achieved by other means currently available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue moved to product team backlog. Will be closed when addressed. update needed For items that are in progress but have not been updated
Projects
None yet
Development

No branches or pull requests

3 participants