public:
static property SpeechRecognizerInformation^ Default {
SpeechRecognizerInformation^ get ();
}
Type: SpeechRecognizerInformation
This property returns ERROR_FILE_NOT_FOUND. To get the language of the console, use the SpeechRecognizer Class class, as shown in the following example.
// Attempt to create recognizer and verify speech locale matches title. If the
// default recognition locale does not match title locale, speech should not be
// enabled by default. Only if the user explicitly chooses to enable speech in a
// specific locale should a non-default locale be used.
Windows::Xbox::Speech::Recognition::SpeechRecognizer^ m_reco;
{
// Create a speech recognizer. If the default speech recognition language is
// unsupported, the following line will raise an exception.
m_reco = ref new SpeechRecognizer();
// To ensure a good user experience, speech should only be enabled by default
// if the language the system uses for speech recognition matches the game's.
wchar_t localeName[ LOCALE_NAME_MAX_LENGTH ];
GetUserDefaultLocaleName( localeName, ARRAYSIZE( localeName ) );
if ( 0 != _wcsicmp( localeName, m_reco->GetRecognizer()->Language->Data() ) )
{
// Speech should not be initialized due to locale mismatch
m_reco = nullptr;
}
else
{
// Initialize speech as the locales match
}
}
Namespace: Windows.Xbox.Speech.Recognition
Metadata: windows.winmd
InstalledSpeechRecognizers Class