Skip to content

Commit 1deb958

Browse files
Merge pull request #280075 from sally-baolian/patch-265
Update how-to-pronunciation-assessment.md
2 parents 1ceb8c0 + d56c066 commit 1deb958

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

articles/ai-services/speech-service/how-to-pronunciation-assessment.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,73 @@ For how to use Pronunciation Assessment in streaming mode in your own applicatio
8080
## Set configuration parameters
8181

8282
::: zone pivot="programming-language-go"
83+
8384
> [!NOTE]
8485
> Pronunciation assessment is not available with the Speech SDK for Go. You can read about the concepts in this guide. Select another programming language for your solution.
86+
87+
::: zone-end
88+
89+
In the `SpeechRecognizer`, you can specify the language to learn or practice improving pronunciation. The default locale is `en-US`. To learn how to specify the learning language for pronunciation assessment in your own application, you can use the following sample code.
90+
91+
::: zone pivot="programming-language-csharp"
92+
93+
```csharp
94+
var recognizer = new SpeechRecognizer(config, "en-US", audioInput);
95+
```
96+
97+
::: zone-end
98+
99+
::: zone pivot="programming-language-cpp"
100+
101+
```cpp
102+
auto recognizer = SpeechRecognizer::FromConfig(config, "en-US", audioConfig);
103+
```
104+
105+
::: zone-end
106+
107+
::: zone pivot="programming-language-java"
108+
109+
```Java
110+
SpeechRecognizer recognizer = new SpeechRecognizer(config, "en-US", audioInput);
111+
```
112+
85113
::: zone-end
86114

87-
In the `SpeechRecognizer`, you can specify the language to learn or practice improving pronunciation. The default locale is `en-US`. To learn how to specify the learning language for pronunciation assessment in your own application, see [sample code](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/csharp/sharedcontent/console/speech_recognition_samples.cs#LL1086C13-L1086C98).
115+
::: zone pivot="programming-language-python"
116+
117+
```Python
118+
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, language="en-US", audio_config=audio_config)
119+
```
120+
121+
::: zone-end
122+
123+
::: zone pivot="programming-language-javascript"
124+
125+
```JavaScript
126+
speechConfig.speechRecognitionLanguage = "en-US";
127+
```
128+
129+
::: zone-end
130+
131+
::: zone pivot="programming-language-objectivec"
132+
133+
```ObjectiveC
134+
SPXSpeechRecognizer* speechRecognizer = [[SPXSpeechRecognizer alloc] initWithSpeechConfiguration:speechConfig language:@"en-US" audioConfiguration:pronAudioSource];
135+
```
136+
137+
::: zone-end
138+
139+
::: zone pivot="programming-language-swift"
140+
141+
```swift
142+
let reco = try! SPXSpeechRecognizer(speechConfiguration: speechConfig, language: "en-US", audioConfiguration: audioInput)
143+
```
144+
145+
::: zone-end
146+
147+
::: zone pivot="programming-language-go"
148+
149+
::: zone-end
88150

89151
> [!TIP]
90152
> If you aren't sure which locale to set for a language that has multiple locales, try each locale separately. For instance, for Spanish, try `es-ES` and `es-MX`. Determine which locale scores higher for your scenario.

0 commit comments

Comments
 (0)