To call a specific public base model ID in the Streaming Speech-To-Text SDK, you can specify the model ID in the SpeechConfig
object when creating a SpeechRecognizer
instance. Here's an example in C#:
// Replace "YourSubscriptionKey" and "YourServiceRegion" with your own values
var config = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
config.SpeechRecognitionLanguage = "en-US";
config.SetProperty("cid", Guid.NewGuid().ToString()); // Optional: set a client ID for logging purposes
config.SetProperty("modelId", "YourBaseModelId"); // Replace "YourBaseModelId" with the ID of the base model you want to use
using var recognizer = new SpeechRecognizer(config);
And here's an example in Java:
// Replace "YourSubscriptionKey" and "YourServiceRegion" with your own values
SpeechConfig config = SpeechConfig.fromSubscription("YourSubscriptionKey", "YourServiceRegion");
config.setSpeechRecognitionLanguage("en-US");
config.setProperty("cid", UUID.randomUUID().toString()); // Optional: set a client ID for logging purposes
config.setProperty("modelId", "YourBaseModelId"); // Replace "YourBaseModelId" with the ID of the base model you want to use
try (SpeechRecognizer recognizer = new SpeechRecognizer(config)) {
// Use the recognizer
}
Note that the modelId
property is only applicable to the following locales: en-US, en-GB, de-DE, es-ES, fr-FR, it-IT, ja-JP, ko-KR, nl-NL, pt-BR, zh-CN, and zh-HK.
References: