2016-11-13 19 views
0

我註冊在我的C#的Windows 10通用應用以下VCD.xml文件,但我不能讓柯塔娜迴應他們,只是冰搜索每個時間。寄存的語音控制定義文件似乎不工作

<?xml version="1.0" encoding="utf-8"?> 
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2"> 
    <CommandSet xml:lang="en-us" Name="UniversalAppCommandSet_en-us"> 
    <AppName> Spang </AppName> 
    <Example> Tell me the time </Example> 
    <Command Name="TellTime"> 
     <Example> tell me the time </Example> 
     <ListenFor RequireAppName="BeforeOrAfterPhrase"> tell me the time </ListenFor> 
     <Feedback> Getting the time for you. </Feedback> 
     <Navigate/> 
    </Command> 
    </CommandSet> 
</VoiceCommands> 

我在OnLaunched上註冊,按照Microsoft的指示。

try 
    { 
     // Install the main VCD. 
     StorageFile pSFeVCD = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/VCD.xml")); 
     await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(pSFeVCD); 
     System.Diagnostics.Debug.WriteLine("Successfully installed voice commands."); 
    } 
    catch (Exception ex) 
    { 
     System.Diagnostics.Debug.WriteLine("Installing Voice Commands Failed: " + ex.ToString()); 
    } 

我試着說和輸入命令,但沒有運氣。它立即執行沒有中止一個Bing搜索。

Nick。

回答

0

好吧,我想通了,我的語言是不正確的,因爲我這臺電腦上有英語(英國),語言應該是「EN-GB」而不是「EN-US」。