Tôi muốn tích hợp các lệnh thoại Cortana vào ứng dụng Windows Phone của mình. Tôi biết rằng bản cập nhật cuối cùng của ứng dụng Wikipedia là Cortana. Đồng thời tôi không thể tìm thấy bất kỳ tài liệu nào về API Cortana. Có ai biết nơi tôi có thể tìm thấy nó?Tài liệu Cortana API có sẵn không?
Trả lời
Đây là một dự án hoàn thành sử dụng Cortana: MSDN Voice Search for Windows Phone 8.1
Không có một điều như một API Cortana, ít nhất là bây giờ.
là gì hiện nay là yêu cầu Cortana bắn ứng dụng của riêng bạn với bất cứ tham số người dùng cho biết, thông tin thêm về điều đó ở đây: http://msdn.microsoft.com/en-us/library/dn630430.aspx
Tại sao tôi nói rằng không phải là một API cho Cortana? Bởi vì bạn không thể lập trình hỏi Cortana về thời tiết hay bất cứ điều gì bạn muốn. Những gì bạn làm là nói với Cortana một cái gì đó để khởi động ứng dụng của bạn và từ thời điểm đó trên đó là ứng dụng của bạn cung cấp cho người dùng những phản hồi, thông tin hoặc bất cứ điều gì cần thiết.
Bạn có thể tích hợp Cortana vào ứng dụng của bạn bằng cách:
Tạo một định nghĩa Voice Command (VCD)
<?xml version="1.0" encoding="utf-8" ?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en-us" Name="HomeControlCommandSet_en-us">
<CommandPrefix>HomeControl</CommandPrefix>
<Example>Control alarm, temperature, light and others</Example>
<Command Name="Activate_Alarm">
<Example>Activate alarm</Example>
<ListenFor>[Would] [you] [please] activate [the] alarm [please]</ListenFor>
<ListenFor RequireAppName="BeforeOrAfterPhrase">Activate alarm</ListenFor>
<Feedback>Activating alarm</Feedback>
<Navigate />
</Command>
<Command Name="Change_Temperature">
<Example>Change temperature to 25º degrees</Example>
<ListenFor>Change temperature to {temperature} degrees</ListenFor>
<Feedback>Changing temperature to {temperature} degrees</Feedback>
<Navigate />
</Command>
<Command Name="Change_Light_Color">
<Example>Change light color to yellow</Example>
<ListenFor>Change light color to {colors}</ListenFor>
<Feedback>Changing light color to {colors}</Feedback>
<Navigate />
</Command>
<PhraseList Label="colors">
<Item>yellow</Item>
<Item>green</Item>
<Item>red</Item>
</PhraseList>
<PhraseTopic Label="temperature">
</PhraseTopic>
</CommandSet>
</VoiceCommands>
Đăng ký VCD tại App Startup
StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(@"HomeControlCommands.xml");
await VoiceCommandManager.InstallCommandSetsFromStorageFileAsync(vcdStorageFile);
Xử lý lệnh
protected override void OnActivated(IActivatedEventArgs e)
{
// Handle when app is launched by Cortana
if (e.Kind == ActivationKind.VoiceCommand)
{
VoiceCommandActivatedEventArgs commandArgs = e as VoiceCommandActivatedEventArgs;
SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
string voiceCommandName = speechRecognitionResult.RulePath[0];
string textSpoken = speechRecognitionResult.Text;
IReadOnlyList<string> recognizedVoiceCommandPhrases;
System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName);
System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken);
switch (voiceCommandName)
...
}
Bạn có thể tìm thêm thông tin tại http://talkitbr.com/2015/07/13/integrando-a-cortana-em-seu-aplicativo-windows-10/
Ngoài ra, nếu bạn quan tâm đến việc đáp ứng với người dùng thông qua cửa sổ Cortana, kiểm tra post này về Cortana ở chế độ nền.
- 1. Tài liệu 'repo' của Android có sẵn?
- 2. Có bất kỳ công cụ tài liệu API javascript ngoại tuyến nào có sẵn như YARD cho ruby không?
- 3. CCNet API, tài liệu?
- 4. Tài liệu API Roslyn
- 5. API Zeroconf có sẵn trong Android không?
- 6. Có sẵn API Google Transit không?
- 7. Tài liệu API JQGrid
- 8. Có tài liệu/API cho định dạng tệp PBix không?
- 9. ffmpeg Tài liệu/hướng dẫn API C
- 10. Swagger API không làm mới tài liệu
- 11. tài liệu jquery sẵn sàng xử lý
- 12. Android Youtube API có sẵn?
- 13. Không đồng bộ và tài liệu sẵn sàng
- 14. jQuery (tài liệu) .không đợi DOM sẵn sàng
- 15. Tài liệu API Castle Bouncy ở đâu?
- 16. Tài liệu API JAPA SOAP?
- 17. Tài liệu Api cho Rspec?
- 18. Tài liệu Flash ActiveX API?
- 19. cách tạo tài liệu api
- 20. Tạo tài liệu REST API
- 21. Tài liệu API Google Voice
- 22. tài liệu web-api & swagger
- 23. tài liệu API tập trung cho microservices
- 24. API bản đồ bầu trời có sẵn không?
- 25. Tài liệu Perl 6 có sẵn cho người đọc điện tử không?
- 26. đang sử dụng tài liệu javascript sẵn sàng hai lần trong một tài liệu ok?
- 27. API YouTube xuất hiện không còn có sẵn
- 28. Plugin netbeans scala - không có tài liệu
- 29. Tạo PDF từ tài liệu API Swagger
- 30. Tài liệu API riêng tư trên iOS
Tôi đã thấy rất nhiều bài viết trên kênh 9 về điều này. Đây có thể là điểm khởi đầu tốt: http://channel9.msdn.com/coding4fun/blog/Cortana-show-me-how-I-can-add-you-to-my-apps Ngoài ra: http: // www .wp7connect.com/2014/04/06/new-in-depth-cortana-build-session-hiển thị-tính năng-ứng dụng-tích hợp-video / –