You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/speech-service/how-to-lower-speech-synthesis-latency.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,18 +320,28 @@ For Android, iOS and macOS, no extra configuration is needed starting version 1.
320
320
321
321
## Text streaming
322
322
323
-
The text stream API allows real-time text processing for rapid audio generation. It's perfect for dynamic text vocalization, such as reading outputs from AI models like GPT in real-time. This API minimizes latency and improves the fluidity and responsiveness of audio outputs, making it ideal for interactive applications, live events, and responsive AI-driven dialogues.
323
+
Text streaming allows real-time text processing for rapid audio generation. It's perfect for dynamic text vocalization, such as reading outputs from AI models like GPT in real-time. This feature minimizes latency and improves the fluidity and responsiveness of audio outputs, making it ideal for interactive applications, live events, and responsive AI-driven dialogues.
324
324
325
-
### How to use the text stream API
325
+
### How to use text streaming
326
326
327
-
To use the text stream API, connect to the websocket V2 endpoint: `wss://{region}.tts.speech.microsoft.com/cognitiveservices/websocket/v2`
327
+
To use the text streaming feature, connect to the websocket V2 endpoint: `wss://{region}.tts.speech.microsoft.com/cognitiveservices/websocket/v2`
328
328
329
329
::: zone pivot="programming-language-csharp"
330
330
331
+
See the sample code for setting the endpoint:
332
+
333
+
```csharp
334
+
// IMPORTANT: MUST use the websocket v2 endpoint
335
+
var ttsEndpoint = $"wss://{Environment.GetEnvironmentVariable("AZURE_TTS_REGION")}.tts.speech.microsoft.com/cognitiveservices/websocket/v2";
1.**Create a text stream request**: Use `SpeechSynthesisRequestInputType.TextStream` to initiate a text stream.
334
-
1. **Set global properties**: Adjust settings such as output format and voice name directly, as the API handles partial text inputs and doesn't support SSML. Refer to the following sample code for instructions on how to set them.
344
+
1.**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.
0 commit comments