Skip to content

Commit 2f44c04

Browse files
authored
Merge pull request #212175 from eric-urban/eur/tts-how-to
TTS how to
2 parents 3b9f361 + f6b8751 commit 2f44c04

23 files changed

+1120
-566
lines changed

articles/cognitive-services/Speech-Service/how-to-migrate-to-custom-neural-voice.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ If you've created a custom voice font, use the endpoint that you've created. You
7474
| Brazil South | `https://brazilsouth.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |
7575
| Canada Central | `https://canadacentral.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |
7676
| Central US | `https://centralus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |
77-
| China East 2 | `https://chinaeast2.voice.speech.azure.cn/cognitiveservices/v1?deploymentId={deploymentId}` |
7877
| East Asia | `https://eastasia.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |
7978
| East US | `https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |
8079
| East US 2 | `https://eastus2.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId={deploymentId}` |

articles/cognitive-services/Speech-Service/how-to-speech-synthesis.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,6 @@ keywords: text to speech
5858
[!INCLUDE [CLI include](includes/how-to/speech-synthesis/cli.md)]
5959
::: zone-end
6060

61-
## Get facial pose events
62-
63-
Speech can be a good way to drive the animation of facial expressions.
64-
[Visemes](how-to-speech-synthesis-viseme.md) are often used to represent the key poses in observed speech. Key poses include the position of the lips, jaw, and tongue in producing a particular phoneme.
65-
66-
You can subscribe to viseme events in the Speech SDK. Then, you can apply viseme events to animate the face of a character as speech audio plays.
67-
Learn [how to get viseme events](how-to-speech-synthesis-viseme.md#get-viseme-events-with-the-speech-sdk).
68-
69-
## Get position information
70-
71-
Your project might need to know when a word is spoken by text-to-speech so that it can take specific action based on that timing. For example, if you want to highlight words as they're spoken, you need to know what to highlight, when to highlight it, and for how long to highlight it.
72-
73-
You can accomplish this by using the `WordBoundary` event within `SpeechSynthesizer`. This event is raised at the beginning of each new spoken word. It provides a time offset within the spoken stream and a text offset within the input prompt:
74-
75-
* `AudioOffset` reports the output audio's elapsed time between the beginning of synthesis and the start of the next word. This is measured in hundred-nanosecond units (HNS), with 10,000 HNS equivalent to 1 millisecond.
76-
* `WordOffset` reports the character position in the input string (original text or [SSML](speech-synthesis-markup.md)) immediately before the word that's about to be spoken.
77-
78-
> [!NOTE]
79-
> `WordBoundary` events are raised as the output audio data becomes available, which will be faster than playback to an output device. The caller must appropriately synchronize streaming and real time.
80-
81-
You can find examples of using `WordBoundary` in the [text-to-speech samples](https://aka.ms/csspeech/samples) on GitHub.
82-
8361
## Next steps
8462

8563
* [Get started with Custom Neural Voice](how-to-custom-voice.md)

articles/cognitive-services/Speech-Service/includes/cognitive-services-speech-service-endpoints-text-to-speech.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Use this table to determine *availability of neural voices* by region or endpoin
1616
| Brazil South | `https://brazilsouth.tts.speech.microsoft.com/cognitiveservices/v1` |
1717
| Canada Central | `https://canadacentral.tts.speech.microsoft.com/cognitiveservices/v1` |
1818
| Central US | `https://centralus.tts.speech.microsoft.com/cognitiveservices/v1` |
19-
| China East 2 | `https://chinaeast2.tts.speech.azure.cn/cognitiveservices/v1` |
20-
| China North 2 | `https://chinanorth2.tts.speech.azure.cn/cognitiveservices/v1` |
2119
| East Asia | `https://eastasia.tts.speech.microsoft.com/cognitiveservices/v1` |
2220
| East US | `https://eastus.tts.speech.microsoft.com/cognitiveservices/v1` |
2321
| East US 2 | `https://eastus2.tts.speech.microsoft.com/cognitiveservices/v1` |

articles/cognitive-services/Speech-Service/includes/cognitive-services-speech-service-rest-auth.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ms.date: 07/01/2021
66
ms.author: erhopf
77
---
88

9-
## Authentication
10-
119
Each request requires an authorization header. This table illustrates which headers are supported for each feature:
1210

1311
| Supported authorization header | Speech-to-text | Text-to-speech |

articles/cognitive-services/Speech-Service/includes/how-to/recognize-speech/cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Create a `SpeechConfig` instance by using your key and region. Create a Speech r
2020
using namespace std;
2121
using namespace Microsoft::CognitiveServices::Speech;
2222

23-
auto config = SpeechConfig::FromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
23+
auto config = SpeechConfig::FromSubscription("YourSpeechKey", "YourSpeechRegion");
2424
```
2525
2626
You can initialize `SpeechConfig` in a few other ways:

articles/cognitive-services/Speech-Service/includes/how-to/recognize-speech/csharp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Program
2828
{
2929
async static Task Main(string[] args)
3030
{
31-
var speechConfig = SpeechConfig.FromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
31+
var speechConfig = SpeechConfig.FromSubscription("YourSpeechKey", "YourSpeechRegion");
3232
}
3333
}
3434
```
@@ -67,7 +67,7 @@ class Program
6767

6868
async static Task Main(string[] args)
6969
{
70-
var speechConfig = SpeechConfig.FromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
70+
var speechConfig = SpeechConfig.FromSubscription("YourSpeechKey", "YourSpeechRegion");
7171
await FromMic(speechConfig);
7272
}
7373
}
@@ -99,7 +99,7 @@ class Program
9999

100100
async static Task Main(string[] args)
101101
{
102-
var speechConfig = SpeechConfig.FromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
102+
var speechConfig = SpeechConfig.FromSubscription("YourSpeechKey", "YourSpeechRegion");
103103
await FromFile(speechConfig);
104104
}
105105
}
@@ -142,7 +142,7 @@ class Program
142142

143143
async static Task Main(string[] args)
144144
{
145-
var speechConfig = SpeechConfig.FromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
145+
var speechConfig = SpeechConfig.FromSubscription("YourSpeechKey", "YourSpeechRegion");
146146
await FromStream(speechConfig);
147147
}
148148
}

articles/cognitive-services/Speech-Service/includes/how-to/recognize-speech/go.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func cancelledHandler(event speech.SpeechRecognitionCanceledEventArgs) {
5353
}
5454

5555
func main() {
56-
subscription := "<paste-your-speech-key-here>"
57-
region := "<paste-your-speech-location/region-here>"
56+
subscription := "YourSpeechKey"
57+
region := "YourSpeechRegion"
5858

5959
audioConfig, err := audio.NewAudioConfigFromDefaultMicrophoneInput()
6060
if err != nil {
@@ -117,8 +117,8 @@ import (
117117
)
118118

119119
func main() {
120-
subscription := "<paste-your-speech-key-here>"
121-
region := "<paste-your-speech-location/region-here>"
120+
subscription := "YourSpeechKey"
121+
region := "YourSpeechRegion"
122122
file := "path/to/file.wav"
123123

124124
audioConfig, err := audio.NewAudioConfigFromWavFileInput(file)

articles/cognitive-services/Speech-Service/includes/how-to/recognize-speech/javascript.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To call the Speech service by using the Speech SDK, you need to create a [`Speec
1818
Create a `SpeechConfig` instance by using your key and location/region. Create a Speech resource on the [Azure portal](https://portal.azure.com). For more information, see [Create a new Azure Cognitive Services resource](~/articles/cognitive-services/cognitive-services-apis-create-account.md?tabs=speech#create-a-new-azure-cognitive-services-resource).
1919

2020
```javascript
21-
const speechConfig = sdk.SpeechConfig.fromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
21+
const speechConfig = sdk.SpeechConfig.fromSubscription("YourSpeechKey", "YourSpeechRegion");
2222
```
2323

2424
You can initialize `SpeechConfig` in a few other ways:
@@ -44,7 +44,7 @@ To recognize speech from an audio file, create an `AudioConfig` instance by usin
4444
```javascript
4545
const fs = require('fs');
4646
const sdk = require("microsoft-cognitiveservices-speech-sdk");
47-
const speechConfig = sdk.SpeechConfig.fromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
47+
const speechConfig = sdk.SpeechConfig.fromSubscription("YourSpeechKey", "YourSpeechRegion");
4848

4949
function fromFile() {
5050
let audioConfig = sdk.AudioConfig.fromWavFileInput(fs.readFileSync("YourAudioFile.wav"));
@@ -69,7 +69,7 @@ For many use cases, your audio data will likely come from blob storage. Or it wi
6969
```javascript
7070
const fs = require('fs');
7171
const sdk = require("microsoft-cognitiveservices-speech-sdk");
72-
const speechConfig = sdk.SpeechConfig.fromSubscription("<paste-your-speech-key-here>", "<paste-your-speech-location/region-here>");
72+
const speechConfig = sdk.SpeechConfig.fromSubscription("YourSpeechKey", "YourSpeechRegion");
7373

7474
function fromStream() {
7575
let pushStream = sdk.AudioInputStream.createPushStream();

articles/cognitive-services/Speech-Service/includes/how-to/recognize-speech/python.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To call the Speech service by using the Speech SDK, you need to create a [`Speec
1717
Create a `SpeechConfig` instance by using your speech key and location/region. Create a Speech resource on the [Azure portal](https://portal.azure.com). For more information, see [Create a new Azure Cognitive Services resource](~/articles/cognitive-services/cognitive-services-apis-create-account.md?tabs=speech#create-a-new-azure-cognitive-services-resource).
1818

1919
```Python
20-
speech_config = speechsdk.SpeechConfig(subscription="<paste-your-speech-key-here>", region="<paste-your-speech-location/region-here>")
20+
speech_config = speechsdk.SpeechConfig(subscription="YourSpeechKey", region="YourSpeechRegion")
2121
```
2222

2323
You can initialize [`SpeechConfig`](/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechconfig) in a few other ways:
@@ -37,7 +37,7 @@ To recognize speech by using your device microphone, create a `SpeechRecognizer`
3737
import azure.cognitiveservices.speech as speechsdk
3838

3939
def from_mic():
40-
speech_config = speechsdk.SpeechConfig(subscription="<paste-your-speech-key-here>", region="<paste-your-speech-location/region-here>")
40+
speech_config = speechsdk.SpeechConfig(subscription="YourSpeechKey", region="YourSpeechRegion")
4141
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config)
4242

4343
print("Speak into your microphone.")
@@ -57,7 +57,7 @@ If you want to recognize speech from an audio file instead of using a microphone
5757
import azure.cognitiveservices.speech as speechsdk
5858

5959
def from_file():
60-
speech_config = speechsdk.SpeechConfig(subscription="<paste-your-speech-key-here>", region="<paste-your-speech-location/region-here>")
60+
speech_config = speechsdk.SpeechConfig(subscription="YourSpeechKey", region="YourSpeechRegion")
6161
audio_input = speechsdk.AudioConfig(filename="your_file_name.wav")
6262
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input)
6363

articles/cognitive-services/Speech-Service/includes/how-to/speech-synthesis/cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.author: eur
2121
Now you're ready to run the Speech CLI to synthesize speech from text. From the command line, change to the directory that contains the Speech CLI binary file. Then run the following command:
2222

2323
```bash
24-
spx synthesize --text "The speech synthesizer greets you!"
24+
spx synthesize --text "I'm excited to try text-to-speech"
2525
```
2626

2727
The Speech CLI will produce natural language in English through the computer speaker.
@@ -31,7 +31,7 @@ The Speech CLI will produce natural language in English through the computer spe
3131
Run the following command to change the output from your speaker to a .wav file:
3232

3333
```bash
34-
spx synthesize --text "The speech synthesizer greets you!" --audio output greetings.wav
34+
spx synthesize --text "I'm excited to try text-to-speech" --audio output greetings.wav
3535
```
3636

37-
The Speech CLI will produce natural language in English in the *greetings.wav* audio file. On Windows, you can play the audio file by entering `start greetings.wav`.
37+
The Speech CLI will produce natural language in English in the `greetings.wav` audio file.

0 commit comments

Comments
 (0)