{"id":515,"date":"2020-05-05T22:39:29","date_gmt":"2020-05-05T14:39:29","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=515"},"modified":"2020-05-05T22:39:29","modified_gmt":"2020-05-05T14:39:29","slug":"xiaobaiassistant%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8e%e7%99%be%e5%ba%a6%e8%af%ad%e9%9f%b3api%e7%9a%84%e7%ae%80%e5%8d%95%e6%99%ba%e8%83%bd%e9%9f%b3%e7%ae%b1%e5%ae%9e%e7%8e%b0%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=515","title":{"rendered":"XiaoBaiAssistant(\u4e00\u4e2a\u57fa\u4e8e\u767e\u5ea6\u8bed\u97f3API\u7684\u7b80\u5355\u667a\u80fd\u97f3\u7bb1\u5b9e\u73b0\u65b9\u6848)"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>\u6838\u5fc3\u4ee3\u7801\u4e0d\u8db3100\u884c\uff0c\u521a\u5165\u95e8Python\u4e5f\u80fd\u770b\u61c2<\/li><li>\u7269\u8054\u7f51+\u4eba\u5de5\u667a\u80fd\u5b66\u4e60\u53c2\u8003\u9879\u76ee<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/wupanhao\/XiaoBaiAssistant#\u57fa\u672c\u8bbe\u7f6e\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u57fa\u672c\u8bbe\u7f6e<\/h2>\n\n\n\n<p>\u5982\u679c\u662f\u4f7f\u7528\u540c\u6b3eWM8960\u97f3\u9891\u6269\u5c55\u677f(\u5e26\u5c0f\u5587\u53ed)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5\u97f3\u9891\u6269\u5c55\u677f\u7684\u9a71\u52a8\ngit clone https:\/\/github.com\/respeaker\/seeed-voicecard\ncd seeed-voicecard\nsudo .\/install.sh \nsudo reboot\n\n<\/code><\/pre>\n\n\n\n<p><del><code>\u4e0b\u9762\u8fd9\u4e2a\u9a71\u52a8\u8c8c\u4f3c\u5728\u6700\u65b0\u7cfb\u7edf\u4e0a\u5b89\u88c5\u5931\u8d25\uff0c\u4e0d\u5efa\u8bae\u91c7\u7528<\/code><\/del><br><del><code>git clone https:\/\/github.com\/waveshare\/WM8960-Audio-HAT<\/code><\/del><br><del><code>cd WM8960-Audio-HAT<\/code><\/del><br><del><code>sudo .\/install.sh<\/code><\/del> <del><code>sudo reboot<\/code><\/del><br>\u4e5f\u53ef\u4ee5\u901a\u8fc7USB\u58f0\u5361\u6216USB\u6444\u50cf\u5934\u63a5\u5165\u9ea6\u514b\u98ce \u7136\u540e\u4f60\u9700\u8981\u7f16\u8f91\u81ea\u5df1HOME\u76ee\u5f55\u4e0b\u7684.asoundrc\u6587\u4ef6\u6307\u5b9a\u9ed8\u8ba4\u64ad\u653e\u5f55\u97f3\u7684\u8bbe\u5907\uff0c\u5927\u6982\u662f\u8fd9\u4e2a\u6837\u5b50\u7684 \u97f3\u9891\u8f93\u5165\u8f93\u51fa\u63a5\u53e3\u53ef\u4ee5\u901a\u8fc7<code>arecord -l<\/code> \u548c <code>aplay -l<\/code>\u67e5\u770b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pcm.!default {\n  type asym\n  capture.pcm \"mic\"\n  playback.pcm \"speaker\"\n}\npcm.mic {\n  type plug\n  slave {\n    pcm \"hw:1,0\"\n  }\n}\npcm.speaker {\n  type plug\n  slave {\n    pcm \"hw:1,0\"\n\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u514b\u9686\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/wupanhao\/XiaoBaiAssistant\ncd XiaoBaiAssistant\/\ncp _snowboydetect_py3.so _snowboydetect.so\ncp config.yaml.example config.yaml\n<\/code><\/pre>\n\n\n\n<p>\u524d\u5f80\u767e\u5ea6\u8bed\u97f3\u5f00\u653e\u5e73\u53f0\u3001\u56fe\u7075\u673a\u5668\u4eba\u5b98\u7f51\u6ce8\u518c\u8d26\u53f7\uff0c\u5728config.yaml\u586b\u5199\u81ea\u5df1\u7684API\u5bc6\u94a5\u7b49\u4fe1\u606f<br>\u9ed8\u8ba4\u5524\u9192\u8bcd\u662f\u7528\u201c\u5c0f\u767d\u201d\u4f5c\u4e3a\u5524\u9192\u8bcd\uff0c\u5e76\u4e14\u662f\u79c1\u4eba\u6a21\u578b\uff0c\u5bf9\u6211\u4ee5\u5916\u7684\u4eba\u5524\u9192\u6548\u679c\u53ef\u80fd\u4e0d\u592a\u597d\uff0c\u53ef\u524d\u5f80<a href=\"https:\/\/snowboy.kitt.ai\/\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/snowboy.kitt.ai\/<\/a> \u8bad\u7ec3\u81ea\u5df1\u7684\u5524\u9192\u8bcd\u6a21\u578b\u66ff\u6362\uff0c\u66f4\u6539\u4ee3\u7801\u91cc\u9762\u7684\u201c\u5c0f\u767d.pmdl\u201d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/wupanhao\/XiaoBaiAssistant#\u73af\u5883\u642d\u5efa\u539f\u751f\u7cfb\u7edf\u4e0d\u5e26keras\u73af\u5883\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u73af\u5883\u642d\u5efa(\u539f\u751f\u7cfb\u7edf,\u4e0d\u5e26keras\u73af\u5883)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install python3-pyaudio libatlas-base-dev libglib2.0-dev mpg123\nsudo pip3 install pyyaml baidu-aip broadlink bluepy\ncd ~\/XiaoBaiAssistant\npython3 demo.py\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/wupanhao\/XiaoBaiAssistant#\u73af\u5883\u642d\u5efa\u57fa\u4e8edocker\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u73af\u5883\u642d\u5efa(\u57fa\u4e8eDocker)<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5Docker(\u5e26keras\u73af\u5883)\ncurl -fsSL https:\/\/get.docker.com -o get-docker.sh\nsh get-docker.sh\nsudo docker run --rm -it --name=\"xiaobai\" --privileged --net=host -v \/home\/pi\/XiaoBaiAssistant:\/xiaobai wupanhao\/xiaobai-assistant:v1 env LANG=C.UTF-8 \/usr\/local\/bin\/jupyter-notebook --ip 0.0.0.0 --allow-root --notebook-dir \/xiaobai\/notebook\/ \n\u4e4b\u540e\u6253\u5f00http:\/\/&#91;\u6811\u8393\u6d3eip]:8888\u8fdb\u5165Jupyter Notebook\u7684\u73af\u5883\n<\/code><\/pre>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/github.com\/wupanhao\/XiaoBaiAssistant\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >https:\/\/github.com\/wupanhao\/XiaoBaiAssistant<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"515\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u6838\u5fc3\u4ee3\u7801\u4e0d\u8db3100\u884c\uff0c\u521a\u5165\u95e8Python\u4e5f\u80fd\u770b\u61c2 \u7269\u8054\u7f51+\u4eba\u5de5\u667a\u80fd\u5b66\u4e60\u53c2\u8003\u9879\u76ee \u57fa\u672c\u8bbe\u7f6e \u5982\u679c\u662f\u4f7f\u7528\u540c\u6b3eWM8960\u97f3\u9891\u6269\u5c55\u677f(\u5e26 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-515","post","type-post","status-publish","format-standard","hentry","category-10"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=515"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/515\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}