{"action":"closed","issue":{"url":"https://api.github.com/repos/dingdang-robot/dingdang-robot/issues/104","repository_url":"https://api.github.com/repos/dingdang-robot/dingdang-robot","labels_url":"https://api.github.com/repos/dingdang-robot/dingdang-robot/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/dingdang-robot/dingdang-robot/issues/104/comments","events_url":"https://api.github.com/repos/dingdang-robot/dingdang-robot/issues/104/events","html_url":"https://github.com/dingdang-robot/dingdang-robot/issues/104","id":362936512,"node_id":"MDU6SXNzdWUzNjI5MzY1MTI=","number":104,"title":"无法播放声音","user":{"login":"calvingit","id":2109371,"node_id":"MDQ6VXNlcjIxMDkzNzE=","avatar_url":"https://avatars2.githubusercontent.com/u/2109371?v=4","gravatar_id":"","url":"https://api.github.com/users/calvingit","html_url":"https://github.com/calvingit","followers_url":"https://api.github.com/users/calvingit/followers","following_url":"https://api.github.com/users/calvingit/following{/other_user}","gists_url":"https://api.github.com/users/calvingit/gists{/gist_id}","starred_url":"https://api.github.com/users/calvingit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvingit/subscriptions","organizations_url":"https://api.github.com/users/calvingit/orgs","repos_url":"https://api.github.com/users/calvingit/repos","events_url":"https://api.github.com/users/calvingit/events{/privacy}","received_events_url":"https://api.github.com/users/calvingit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-23T11:52:42Z","updated_at":"2018-09-23T15:05:52Z","closed_at":"2018-09-23T15:05:52Z","author_association":"NONE","body":"# **确认已寻找过答案**\r\n\r\n我已确认在 [Github issue](https://github.com/dingdang-robot/dingdang-robot/issues) 页、[常见问题](https://github.com/dingdang-robot/dingdang-robot/wiki/troubleshooting)页、[论坛](http://bbs.hahack.com) 中都查找过，没有找到类似问题。我也没有 google / bing/ 百度 / duckduckgo 到相关问题。\r\n\r\n# **安装方式**\r\n\r\n镜像安装\r\n\r\n# **操作系统**\r\n\r\n版本是dingdang-2018-07-16\r\n\r\n# **问题描述**\r\n一切按照镜像安装的方式修改profile.yml，启动后微信登录，文本发送都正常，可以使用“叮当”唤醒，但是语音播放的时候就报错了，以下几种情况都是一样的：\r\n\r\n- 微信语音发送，无法播放\r\n- 邮件读取，无法播放\r\n- 调用网易云歌曲播放，无法播放\r\n\r\n具体错误log如下：\r\n```bash\r\nException in thread Thread-16:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/threading.py\", line 801, in __bootstrap_inner\r\n    self.run()\r\n  File \"/home/pi/dingdang/client/player.py\", line 66, in run\r\n    output=True)\r\n  File \"/usr/lib/python2.7/dist-packages/pyaudio.py\", line 750, in open\r\n    stream = Stream(self, *args, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/pyaudio.py\", line 441, in __init__\r\n    self._stream = pa.open(**arguments)\r\nIOError: [Errno -9996] Invalid output device (no default output device)\r\n```\r\n\r\n`~/.asoundrc`配置如下：\r\n\r\n```\r\npcm.!default {\r\n        type asym\r\n            playback.pcm {\r\n                type plug\r\n                slave.pcm \"hw:0,1\"\r\n            }\r\n            capture.pcm {\r\n                type plug\r\n                slave.pcm \"hw:1,0\"\r\n            }\r\n}\r\n\r\nctl.!default {\r\n        type hw\r\n        card 0\r\n}\r\n```\r\n\r\n单独使用`arecord`可以录音，使用`aplay`播放也没问题。即使单独写了一个`pyaudio`的例子，也可以录音和播放\r\n\r\n# 硬件\r\n树莓派：3B+\r\n音频输入：USB 麦克风\r\n音频输出：3.5mm接到音箱\r\n"}}
{"actor":{"display_login":"calvingit"}}