Skip to content

Commit 210b39c

Browse files
Merge pull request #3352 from BrianMouncer/brianem/1.43.0_updates
Brianem/1.43.0 updates
2 parents 787e367 + 06527a3 commit 210b39c

File tree

27 files changed

+612
-151
lines changed

27 files changed

+612
-151
lines changed

articles/ai-services/speech-service/audio-processing-speech-sdk.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This sample shows how to use MAS with all default enhancement options on input f
2828
### [C#](#tab/csharp)
2929

3030
```csharp
31-
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
31+
var speechConfig = SpeechConfig.FromEndpoint(new Uri("YourSpeechEndpoint"), "YourSpeechKey");
3232

3333
var audioProcessingOptions = AudioProcessingOptions.Create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
3434
var audioInput = AudioConfig.FromDefaultMicrophoneInput(audioProcessingOptions);
@@ -39,7 +39,7 @@ var recognizer = new SpeechRecognizer(speechConfig, audioInput);
3939
### [C++](#tab/cpp)
4040

4141
```cpp
42-
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourServiceRegion");
42+
auto speechConfig = SpeechConfig::FromEndpoint("YourServiceEndpoint", "YourSubscriptionKey");
4343

4444
auto audioProcessingOptions = AudioProcessingOptions::Create(AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
4545
auto audioInput = AudioConfig::FromDefaultMicrophoneInput(audioProcessingOptions);
@@ -50,7 +50,7 @@ auto recognizer = SpeechRecognizer::FromConfig(speechConfig, audioInput);
5050
### [Java](#tab/java)
5151

5252
```java
53-
SpeechConfig speechConfig = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
53+
SpeechConfig speechConfig = SpeechConfig.fromEndpoint(new java.net.URI("YourSpeechEndpoint"), "YourSpeechKey");
5454

5555
AudioProcessingOptions audioProcessingOptions = AudioProcessingOptions.create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
5656
AudioConfig audioInput = AudioConfig.fromDefaultMicrophoneInput(audioProcessingOptions);
@@ -69,7 +69,7 @@ This sample shows how to use MAS with a predefined microphone geometry on a spec
6969
### [C#](#tab/csharp)
7070

7171
```csharp
72-
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
72+
var speechConfig = SpeechConfig.FromEndpoint(new Uri("YourSpeechEndpoint"), "YourSpeechKey");
7373

7474
var audioProcessingOptions = AudioProcessingOptions.Create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT, PresetMicrophoneArrayGeometry.Linear2);
7575
var audioInput = AudioConfig.FromMicrophoneInput("hw:0,1", audioProcessingOptions);
@@ -80,7 +80,7 @@ var recognizer = new SpeechRecognizer(speechConfig, audioInput);
8080
### [C++](#tab/cpp)
8181

8282
```cpp
83-
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourServiceRegion");
83+
auto speechConfig = SpeechConfig::FromEndpoint("YourServiceEndpoint", "YourSubscriptionKey");
8484

8585
auto audioProcessingOptions = AudioProcessingOptions::Create(AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT, PresetMicrophoneArrayGeometry::Linear2);
8686
auto audioInput = AudioConfig::FromMicrophoneInput("hw:0,1", audioProcessingOptions);
@@ -91,7 +91,7 @@ auto recognizer = SpeechRecognizer::FromConfig(speechConfig, audioInput);
9191
### [Java](#tab/java)
9292

9393
```java
94-
SpeechConfig speechConfig = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
94+
SpeechConfig speechConfig = SpeechConfig.fromEndpoint(new java.net.URI("YourSpeechEndpoint"), "YourSpeechKey");
9595

9696
AudioProcessingOptions audioProcessingOptions = AudioProcessingOptions.create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT, PresetMicrophoneArrayGeometry.Linear2);
9797
AudioConfig audioInput = AudioConfig.fromMicrophoneInput("hw:0,1", audioProcessingOptions);
@@ -110,7 +110,7 @@ This sample shows how to use MAS with a custom microphone geometry on a specifie
110110
### [C#](#tab/csharp)
111111

112112
```csharp
113-
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
113+
var speechConfig = SpeechConfig.FromEndpoint(new Uri("YourSpeechEndpoint"), "YourSpeechKey");
114114

115115
MicrophoneCoordinates[] microphoneCoordinates = new MicrophoneCoordinates[7]
116116
{
@@ -132,7 +132,7 @@ var recognizer = new SpeechRecognizer(speechConfig, audioInput);
132132
### [C++](#tab/cpp)
133133

134134
```cpp
135-
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourServiceRegion");
135+
auto speechConfig = SpeechConfig::FromEndpoint("YourServiceEndpoint", "YourSubscriptionKey");
136136

137137
MicrophoneArrayGeometry microphoneArrayGeometry
138138
{
@@ -148,7 +148,7 @@ auto recognizer = SpeechRecognizer::FromConfig(speechConfig, audioInput);
148148
### [Java](#tab/java)
149149

150150
```java
151-
SpeechConfig speechConfig = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
151+
SpeechConfig speechConfig = SpeechConfig.fromEndpoint(new java.net.URI("YourSpeechEndpoint"), "YourSpeechKey");
152152

153153
MicrophoneCoordinates[] microphoneCoordinates = new MicrophoneCoordinates[7];
154154
microphoneCoordinates[0] = new MicrophoneCoordinates(0, 0, 0);
@@ -177,7 +177,7 @@ In this example:
177177
### [C#](#tab/csharp)
178178

179179
```csharp
180-
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
180+
var speechConfig = SpeechConfig.FromEndpoint(new Uri("YourSpeechEndpoint"), "YourSpeechKey");
181181

182182
var audioProcessingOptions = AudioProcessingOptions.Create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_DISABLE_ECHO_CANCELLATION | AudioProcessingConstants.AUDIO_INPUT_PROCESSING_DISABLE_NOISE_SUPPRESSION | AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
183183
var audioInput = AudioConfig.FromDefaultMicrophoneInput(audioProcessingOptions);
@@ -188,7 +188,7 @@ var recognizer = new SpeechRecognizer(speechConfig, audioInput);
188188
### [C++](#tab/cpp)
189189

190190
```cpp
191-
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourServiceRegion");
191+
auto speechConfig = SpeechConfig::FromEndpoint("YourServiceEndpoint", "YourSubscriptionKey");
192192

193193
auto audioProcessingOptions = AudioProcessingOptions::Create(AUDIO_INPUT_PROCESSING_DISABLE_ECHO_CANCELLATION | AUDIO_INPUT_PROCESSING_DISABLE_NOISE_SUPPRESSION | AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
194194
auto audioInput = AudioConfig::FromDefaultMicrophoneInput(audioProcessingOptions);
@@ -199,7 +199,7 @@ auto recognizer = SpeechRecognizer::FromConfig(speechConfig, audioInput);
199199
### [Java](#tab/java)
200200

201201
```java
202-
SpeechConfig speechConfig = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
202+
SpeechConfig speechConfig = SpeechConfig.fromEndpoint(new java.net.URI("YourSpeechEndpoint"), "YourSpeechKey");
203203

204204
AudioProcessingOptions audioProcessingOptions = AudioProcessingOptions.create(AudioProcessingConstants.AUDIO_INPUT_PROCESSING_DISABLE_ECHO_CANCELLATION | AudioProcessingConstants.AUDIO_INPUT_PROCESSING_DISABLE_NOISE_SUPPRESSION | AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT);
205205
AudioConfig audioInput = AudioConfig.fromDefaultMicrophoneInput(audioProcessingOptions);
@@ -221,7 +221,7 @@ In the following code example, the start angle is set to 70 degrees and the end
221221
### [C#](#tab/csharp)
222222

223223
```csharp
224-
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
224+
var speechConfig = SpeechConfig.FromEndpoint(new Uri("YourSpeechEndpoint"), "YourSpeechKey");
225225

226226
MicrophoneCoordinates[] microphoneCoordinates = new MicrophoneCoordinates[4]
227227
{
@@ -241,7 +241,7 @@ var recognizer = new SpeechRecognizer(speechConfig, audioInput);
241241
### [C++](#tab/cpp)
242242

243243
```cpp
244-
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey", "YourServiceRegion");
244+
auto speechConfig = SpeechConfig::FromEndpoint("YourServiceEndpoint", "YourSubscriptionKey");
245245

246246
MicrophoneArrayGeometry microphoneArrayGeometry
247247
{
@@ -260,7 +260,7 @@ auto recognizer = SpeechRecognizer::FromConfig(speechConfig, audioInput);
260260
### [Java](#tab/java)
261261

262262
```java
263-
SpeechConfig speechConfig = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
263+
SpeechConfig speechConfig = SpeechConfig.fromEndpoint(new java.net.URI("YourSpeechEndpoint"), "YourSpeechKey");
264264

265265
MicrophoneCoordinates[] microphoneCoordinates = new MicrophoneCoordinates[4];
266266
microphoneCoordinates[0] = new MicrophoneCoordinates(-60, 0, 0);

articles/ai-services/speech-service/embedded-speech.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Follow these steps to install the Speech SDK for Java using Apache Maven:
129129
<dependency>
130130
<groupId>com.microsoft.cognitiveservices.speech</groupId>
131131
<artifactId>client-sdk-embedded</artifactId>
132-
<version>1.42.0</version>
132+
<version>1.43.0</version>
133133
</dependency>
134134
</dependencies>
135135
</project>
@@ -150,7 +150,7 @@ Be sure to use the `@aar` suffix when the dependency is specified in `build.grad
150150

151151
```
152152
dependencies {
153-
implementation 'com.microsoft.cognitiveservices.speech:client-sdk-embedded:1.42.0@aar'
153+
implementation 'com.microsoft.cognitiveservices.speech:client-sdk-embedded:1.43.0@aar'
154154
}
155155
```
156156
::: zone-end
@@ -166,7 +166,7 @@ All text to speech locales [here](language-support.md?tabs=tts) (except fa-IR, P
166166
167167
## Embedded speech configuration
168168
169-
For cloud connected applications, as shown in most Speech SDK samples, you use the `SpeechConfig` object with an API key and region. For embedded speech, you don't use an AI Services resource for Speech. Instead of a cloud resource, you use the [models and voices](#models-and-voices) that you download to your local device.
169+
For cloud connected applications, as shown in most Speech SDK samples, you use the `SpeechConfig` object with an API key and endpoint. For embedded speech, you don't use an AI Services resource for Speech. Instead of a cloud resource, you use the [models and voices](#models-and-voices) that you download to your local device.
170170
171171
Use the `EmbeddedSpeechConfig` object to set the location of the models or voices. If your application is used for both speech to text and text to speech, you can use the same `EmbeddedSpeechConfig` object to set the location of the models and voices.
172172

articles/ai-services/speech-service/how-to-configure-azure-ad-auth.md

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,39 @@ With a Microsoft Entra access token, you can now create a Speech SDK configurati
175175

176176
The method of providing the token, and the method to construct the corresponding Speech SDK ```Config``` object varies by the object you're using.
177177

178-
### SpeechRecognizer, SpeechSynthesizer, IntentRecognizer, ConversationTranscriber
178+
::: zone pivot="programming-language-csharp"
179+
### SpeechRecognizer, SourceLanguageRecognizer, ConversationTranscriber
179180

180-
For ```SpeechRecognizer```, ```SpeechSynthesizer```, ```IntentRecognizer```, ```ConversationTranscriber``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
181+
For ```SpeechRecognizer```, ```SourceLanguageRecognizer```, ```ConversationTranscriber``` objects, use an appropriate instance of [TokenCredential](/dotnet/api/azure.core.tokencredential) for authentication, along with the endpoint that includes your [custom domain](/azure/ai-services/speech-service/speech-services-private-link?tabs=portal#create-a-custom-domain-name), to create a ```SpeechConfig``` object.
182+
183+
```C#
184+
TokenCredential browserCredential = new InteractiveBrowserCredential();
185+
186+
// Define the custom domain endpoint for your Speech resource.
187+
var endpoint = "wss://{your custom name}.cognitiveservices.azure.com/stt/speech/universal/v2";
188+
189+
// Create the SpeechConfig object using the custom domain endpoint and TokenCredential.
190+
var speechConfig = SpeechConfig.FromEndpoint(new Uri(endpoint), browserCredential);
191+
```
192+
193+
### TranslationRecognizer
194+
195+
For ```TranslationRecognizer``` object, use an appropriate instance of [TokenCredential](/dotnet/api/azure.core.tokencredential) for authentication, along with the endpoint that includes your [custom domain](/azure/ai-services/speech-service/speech-services-private-link?tabs=portal#create-a-custom-domain-name), to create a ```SpeechTranslationConfig``` object.
196+
197+
```C#
198+
TokenCredential browserCredential = new InteractiveBrowserCredential();
199+
200+
// Define the custom domain endpoint for your Speech resource
201+
var endpoint = "wss://{your custom name}.cognitiveservices.azure.com/stt/speech/universal/v2";
202+
203+
// Create the SpeechTranslationConfig object using the custom domain endpoint and TokenCredential.
204+
var speechConfig = SpeechTranslationConfig.FromEndpoint(new Uri(endpoint), browserCredential);
205+
```
206+
207+
### SpeechSynthesizer, IntentRecognizer
208+
209+
For ```SpeechSynthesizer```, ```IntentRecognizer``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
181210

182-
::: zone pivot="programming-language-csharp"
183211
```C#
184212
string resourceId = "Your Resource ID";
185213
string aadToken = "Your Microsoft Entra access token";
@@ -192,6 +220,10 @@ var speechConfig = SpeechConfig.FromAuthorizationToken(authorizationToken, regio
192220
::: zone-end
193221

194222
::: zone pivot="programming-language-cpp"
223+
### SpeechRecognizer, SpeechSynthesizer, IntentRecognizer, ConversationTranscriber
224+
225+
For ```SpeechRecognizer```, ```SpeechSynthesizer```, ```IntentRecognizer```, ```ConversationTranscriber``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
226+
195227
```C++
196228
std::string resourceId = "Your Resource ID";
197229
std::string aadToken = "Your Microsoft Entra access token";
@@ -204,6 +236,10 @@ auto speechConfig = SpeechConfig::FromAuthorizationToken(authorizationToken, reg
204236
::: zone-end
205237

206238
::: zone pivot="programming-language-java"
239+
### SpeechRecognizer, SpeechSynthesizer, IntentRecognizer, ConversationTranscriber
240+
241+
For ```SpeechRecognizer```, ```SpeechSynthesizer```, ```IntentRecognizer```, ```ConversationTranscriber``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
242+
207243
```Java
208244
String resourceId = "Your Resource ID";
209245
String region = "Your Region";
@@ -215,6 +251,10 @@ SpeechConfig speechConfig = SpeechConfig.fromAuthorizationToken(authorizationTok
215251
::: zone-end
216252

217253
::: zone pivot="programming-language-python"
254+
### SpeechRecognizer, SpeechSynthesizer, IntentRecognizer, ConversationTranscriber
255+
256+
For ```SpeechRecognizer```, ```SpeechSynthesizer```, ```IntentRecognizer```, ```ConversationTranscriber``` objects, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechConfig``` object.
257+
218258
```Python
219259
resourceId = "Your Resource ID"
220260
region = "Your Region"
@@ -224,23 +264,11 @@ speechConfig = SpeechConfig(auth_token=authorizationToken, region=region)
224264
```
225265
::: zone-end
226266

267+
::: zone pivot="programming-language-cpp"
227268
### TranslationRecognizer
228269

229270
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
230271

231-
::: zone pivot="programming-language-csharp"
232-
```C#
233-
string resourceId = "Your Resource ID";
234-
string aadToken = "Your Microsoft Entra access token";
235-
string region = "Your Speech Region";
236-
237-
// You need to include the "aad#" prefix and the "#" (hash) separator between resource ID and Microsoft Entra access token.
238-
var authorizationToken = $"aad#{resourceId}#{aadToken}";
239-
var speechConfig = SpeechTranslationConfig.FromAuthorizationToken(authorizationToken, region);
240-
```
241-
::: zone-end
242-
243-
::: zone pivot="programming-language-cpp"
244272
```cpp
245273
std::string resourceId = "Your Resource ID";
246274
std::string aadToken = "Your Microsoft Entra access token";
@@ -253,6 +281,10 @@ auto speechConfig = SpeechTranslationConfig::FromAuthorizationToken(authorizatio
253281
::: zone-end
254282

255283
::: zone pivot="programming-language-java"
284+
### TranslationRecognizer
285+
286+
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
287+
256288
```Java
257289
String resourceId = "Your Resource ID";
258290
String region = "Your Region";
@@ -264,6 +296,10 @@ SpeechTranslationConfig translationConfig = SpeechTranslationConfig.fromAuthoriz
264296
::: zone-end
265297

266298
::: zone pivot="programming-language-python"
299+
### TranslationRecognizer
300+
301+
For the ```TranslationRecognizer```, build the authorization token from the resource ID and the Microsoft Entra access token and then use it to create a ```SpeechTranslationConfig``` object.
302+
267303
```Python
268304
resourceId = "Your Resource ID"
269305
region = "Your Region"

articles/ai-services/speech-service/how-to-use-logging.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ manager: nitinme
88
ms.service: azure-ai-speech
99
ms.topic: how-to
1010
ms.date: 3/10/2025
11+
zone_pivot_groups: programming-languages-set-two-objective-c
1112
ms.custom: devx-track-csharp, devx-track-extended-java, devx-track-python
1213
#Customer intent: As a developer, I want to learn how to enable logging in the Speech SDK so that I can get additional information and diagnostics from the Speech SDK's core components.
1314
---
@@ -171,6 +172,29 @@ void DisableSpeechSdkLogging()
171172
}
172173
```
173174
175+
176+
## Logging with file logger, Memory logger and event logger
177+
178+
::: zone pivot="programming-language-csharp"
179+
[!INCLUDE [C# include](includes/how-to/diagnostics/csharp.md)]
180+
::: zone-end
181+
182+
::: zone pivot="programming-language-cpp"
183+
[!INCLUDE [C++ include](includes/how-to/diagnostics/cpp.md)]
184+
::: zone-end
185+
186+
::: zone pivot="programming-language-java"
187+
[!INCLUDE [Java include](includes/how-to/diagnostics/java.md)]
188+
::: zone-end
189+
190+
::: zone pivot="programming-language-objectivec"
191+
[!INCLUDE [ObjectiveC include](includes/how-to/diagnostics/objectivec.md)]
192+
::: zone-end
193+
194+
::: zone pivot="programming-language-python"
195+
[!INCLUDE [Python include](./includes/how-to/diagnostics/python.md)]
196+
::: zone-end
197+
174198
## Next steps
175199
176200
> [!div class="nextstepaction"]
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
author: charles-fu
3+
ms.service: azure-ai-speech
4+
ms.topic: include
5+
ms.date: 03/18/2025
6+
ms.author: changfu001
7+
---
8+
9+
[!INCLUDE [Introduction](intro.md)]
10+
11+
### Samples
12+
13+
```cpp
14+
using namespace Microsoft::CognitiveServices::Speech;
15+
using namespace Microsoft::CognitiveServices::Speech::Diagnostics::Logging;
16+
17+
void FileLoggerWithoutFilters()
18+
{
19+
FileLogger::Start("LogfilePathAndName");
20+
21+
// Other Speech SDK calls
22+
23+
FileLogger::Stop();
24+
}
25+
26+
void FileLoggerWithFilters()
27+
{
28+
std::initializer_list<std::string> filters = { "YourFirstString", "YourSecondString" };
29+
FileLogger::SetFilters(filters);
30+
FileLogger::Start("LogfilePathAndName");
31+
32+
// Other Speech SDK calls
33+
34+
FileLogger::Stop();
35+
FileLogger::SetFilters();
36+
}
37+
38+
void MemoryLoggerWithoutFilters()
39+
{
40+
MemoryLogger::Start();
41+
42+
// Other Speech SDK calls
43+
44+
// At any time (whether logging is stopped) you can dump the traces in memory to a file
45+
MemoryLogger::Dump("LogfilePathAndName");
46+
47+
// Or dump to any stream object that is derived from std::ostream. For example, std::cout
48+
MemoryLogger::Dump(std::cout);
49+
50+
// Or dump to a vector of strings
51+
std::vector<std::string> messages = MemoryLogger::Dump();
52+
53+
MemoryLogger::Stop();
54+
}
55+
56+
void EventLoggerWithoutFilters()
57+
{
58+
std::mutex mtx;
59+
std::vector<std::string> messages;
60+
61+
// Register a callback that will get invoked by Speech SDK on every new log message
62+
EventLogger::SetCallback([&messages, &mtx](std::string message) {
63+
// Store the message for later processing. Better not processing it in the event thread
64+
std::unique_lock<std::mutex> lock(mtx);
65+
messages.push_back(message);
66+
});
67+
68+
// Other Speech SDK calls
69+
70+
// Stop logging by setting an empty callback
71+
EventLogger::SetCallback();
72+
}
73+
```

0 commit comments

Comments
 (0)