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

[Bug]: How to use text streaming #850

Open
stevemao opened this issue Aug 1, 2024 · 5 comments
Open

[Bug]: How to use text streaming #850

stevemao opened this issue Aug 1, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@stevemao
Copy link

stevemao commented Aug 1, 2024

What happened?

On the API docs, I found https://learn.microsoft.com/en-au/azure/ai-services/speech-service/how-to-lower-speech-synthesis-latency?pivots=programming-language-python#text-streaming

But I do not see speechsdk.SpeechSynthesisRequestInputType.TextStream in this library. How do achieve text streaming using this library?

Version

1.36.0 (Latest)

What browser/platform are you seeing the problem on?

Node, browsers, reactjs

Relevant log output

Key steps
Create a text stream request: Use speechsdk.SpeechSynthesisRequestInputType.TextStream to initiate a text stream.

Set global properties: Adjust settings such as output format and voice name directly, as the feature handles partial text inputs and doesn't support SSML. Refer to the following sample code for instructions on how to set them. OpenAI text to speech voices aren't supported by the text streaming feature. See this language table for full language support.

Python

Copy
# set a voice name
speech_config.speech_synthesis_voice_name = "en-US-AvaMultilingualNeural"
Stream your text: For each text chunk generated from a GPT model, use request.input_stream.write(text) to send the text to the stream.

Close the stream: Once the GPT model completes its output, close the stream using request.input_stream.close().
@stevemao stevemao added the bug Something isn't working label Aug 1, 2024
@maisterr
Copy link

maisterr commented Aug 8, 2024

Faced the same problem, it would be useful to know if this is planned to be added to the JS SDK soon

@BrianMouncer
Copy link
Contributor

@yulin-li can you comment on plans to add TextStreaming to JS SDK?

@yulin-li
Copy link
Contributor

Thanks for using the text streaming feature. We need the sync internally for this feature plan. I will reply here once it's clear.

@akshay-jam
Copy link

@yulin-li any update on when this feature will be available in JS SDK

@akshay-jam
Copy link

@BrianMouncer @yulin-li any update on when this feature will be available in JS SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants