{"id":190641,"date":"2023-08-30T01:13:59","date_gmt":"2023-08-29T17:13:59","guid":{"rendered":"https:\/\/www.idc.net\/help\/190641\/"},"modified":"2023-08-30T01:13:59","modified_gmt":"2023-08-29T17:13:59","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e9%b8%bf%e8%92%99os%e6%95%99%e7%a8%8b%ef%bc%9a%e9%b8%bf%e8%92%99os-%e5%8f%af%e8%a7%81%e5%8d%b3%e5%8f%af%e8%af%b4%e5%bc%80%e5%8f%91%e6%8c%87%e5%af%bc","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/190641\/","title":{"rendered":"\u540e\u6d6a\u4e91\u9e3f\u8499OS\u6559\u7a0b\uff1a\u9e3f\u8499OS \u53ef\u89c1\u5373\u53ef\u8bf4\u5f00\u53d1\u6307\u5bfc"},"content":{"rendered":"<p>\u53ef\u89c1\u5373\u53ef\u8bf4\u662f\u8981\u6c42 Component \u4e2d\u901a\u8fc7\u4e0e\u70ed\u8bcd\u5173\u8054\uff0c\u4ece\u800c\u8fbe\u5230\u6307\u5b9a\u7684\u6548\u679c\u3002\u4f8b\u5982\uff1a\u5728\u6d4f\u89c8\u56fe\u7247\u65f6\uff0c\u8bf4\u51fa\u56fe\u7247\u7684\u540d\u5b57\u6216\u89d2\u6807\u5e8f\u53f7\uff0c\u4ece\u800c\u5b9e\u73b0\u6253\u5f00\u56fe\u7247\u7684\u6548\u679c\u3002<\/p>\n<p> \u8bf4\u660e<\/p>\n<p> \u8be5\u529f\u80fd\u76ee\u524d\u4ec5\u5728\u667a\u6167\u5c4f\u4ea7\u54c1\u4e0a\u652f\u6301\u3002<\/p>\n<\/p>\n<h2>\u70ed\u8bcd\u6ce8\u518c<\/h2>\n<\/p>\n<p> \u5f00\u53d1\u8005\u9996\u5148\u9700\u8981\u8fdb\u884c Component \u7684\u70ed\u8bcd\u6ce8\u518c\uff0c\u5373\u544a\u8bc9\u8bbe\u5907\uff0c\u54ea\u4e9b\u70ed\u8bcd\u662f\u8fd9\u4e2a Component \u6240\u9700\u8981\u54cd\u5e94\u7684\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6784\u5efa Component.VoiceEvent \u5bf9\u8c61\uff0c\u9700\u8981\u8bbe\u7f6e\u70ed\u8bcd\uff0c\u4e2d\u82f1\u6587\u90fd\u53ef\u4ee5\u3002<\/li>\n<\/ol>\n<pre><code>   Component.VoiceEvent eventKeys = new Component.VoiceEvent(\"ok\");<\/code><\/pre>\n<\/p>\n<ol>\n<li>\u5982\u679c\u4e00\u4e2a Component \u7684\u540c\u4e00 VoiceEvent \u5b58\u5728\u591a\u4e2a\u70ed\u8bcd\u5339\u914d\uff0c\u53ef\u4ee5\u901a\u8fc7 addSynonyms \u65b9\u6cd5\u589e\u52a0 eventKeys \u7684\u70ed\u8bcd\u3002<\/li>\n<\/ol>\n<pre><code>   eventKeys.addSynonyms(\"\u786e\u5b9a\");<\/code><\/pre>\n<\/p>\n<ol>\n<li>\u5f53 Component.VoiceEvent \u5bf9\u8c61\u64cd\u4f5c\u5b8c\u6210\u540e\uff0c\u4f7f\u7528 Component \u7684 subscribeVoiceEvents \u65b9\u6cd5\u6765\u53d1\u8d77\u6ce8\u518c\u3002<\/li>\n<\/ol>\n<pre><code>   Component.subscribeVoiceEvents(eventKeys);<\/code><\/pre>\n<\/p>\n<ol>\n<li>\u5982\u679c\u4e00\u4e2a Component \u6709\u591a\u4e2a\u4e8b\u4ef6\u9700\u8981\u54cd\u5e94\uff0c\u9700\u8981\u521b\u5efa\u4e0d\u540c\u7684\u4e8b\u4ef6\u6765\u8fdb\u884c\u6ce8\u518c\u3002<\/li>\n<\/ol>\n<h2>\u4e8b\u4ef6\u54cd\u5e94<\/h2>\n<\/p>\n<p> \u5f00\u53d1\u8005\u5b8c\u6210\u70ed\u8bcd\u6ce8\u518c\u540e\uff0c\u9700\u8981\u5173\u6ce8\u7684\u662f\u5bf9\u5e94\u4e8e\u4e0d\u540c\u70ed\u8bcd\u6240\u9700\u8981\u5904\u7406\u7684\u4e8b\u4ef6\u3002\u4e8b\u4ef6\u54cd\u5e94\u56de\u8c03\u7684SpeechEvent\u5bf9\u8c61\u4ec5\u5305\u542b\u4e00\u4e2a\u70ed\u8bcd\u3002<\/p>\n<\/p>\n<ol>\n<li>\u9996\u5148\u9700\u8981\u5b9e\u73b0 SpeechEventListener \u63a5\u53e3\u3002<\/li>\n<\/ol>\n<pre><code>   private Component.SpeechEventListener speechEventListener = new Component.SpeechEventListener(\n       @Override\n       public boolean onSpeechEvent(Component v, SpeechEvent event) {\n           if (event.getActionProperty().equals(\"ok\")) {\n               ... \/\/ \u68c0\u6d4b\u6ce8\u518c\u7684\u70ed\u8bcd\uff0c\u8fdb\u884c\u76f8\u5e94\u7684\u5904\u7406\n           }\n   });<\/code><\/pre>\n<\/p>\n<ol>\n<li>\u901a\u8fc7 setSpeechEventListener \u65b9\u6cd5\u5b9e\u73b0\u56de\u8c03\u6ce8\u518c\u3002<\/li>\n<\/ol>\n<pre><code>   Component.setSpeechEventListener(speechEventListener);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u89c1\u5373\u53ef\u8bf4\u662f\u8981\u6c42 Component \u4e2d\u901a\u8fc7\u4e0e\u70ed\u8bcd\u5173\u8054\uff0c\u4ece\u800c\u8fbe\u5230\u6307\u5b9a\u7684\u6548\u679c\u3002\u4f8b\u5982\uff1a\u5728\u6d4f\u89c8\u56fe\u7247\u65f6\uff0c\u8bf4\u51fa\u56fe\u7247\u7684\u540d\u5b57 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[188588],"tags":[],"class_list":["post-190641","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/190641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=190641"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/190641\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=190641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=190641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=190641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}