Skip to content

Commit

Permalink
Release 0.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Guo committed Jul 1, 2019
1 parent eb86979 commit 0392c1f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.11.3 (released at 07/02/2019)

* New addvoicetorecofortext and queryrecoresultfortext support.
* improve existing class detect by @3014zhangshuo #261
* new wxa_get_wxacode_unlimit API for miniapp by @paicha #260

## v0.11.2 (released at 05/08/2019)

* bugfix short_url to shorturl in wechat console tool by @yuanxinyu #259
Expand Down
8 changes: 7 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,13 @@ class WechatsController < ActionController::Base

# 处理语音信息
on :voice do |request|
request.reply.voice(request[:MediaId]) #直接语音音返回给用户
# 直接语音音返回给用户
# request.reply.voice(request[:MediaId])

voice_id = request[:MediaId]
# 开通语音识别后,用户每次发送语音给服务号时,微信会在推送的语音消息XML数据包中,增加一个Recognition字段
recognition = request[:Recognition]
request.reply.text "#{voice_id} #{recognition}"
end

# 处理视频信息
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,16 @@ end

Using `Wechat.api` to access the wechat api function at any place.

Below is an example via `rails console` to call AI Voice Recognition API:

```bash
# Audio file with ID3 version 2.4.0, contains:MPEG ADTS, layer III, v2, 40 kbps, 16 kHz, Monaural
test_voice_file='test_voice.mp3'
Wechat.api.addvoicetorecofortext('test_voice_id', File.open(test_voice_file))
Wechat.api.queryrecoresultfortext 'test_voice_id'
```


## Checking the signature
Using `Wechat.decrypt(encrypted_data,session_key, iv)` to decode the data. via. [Signature Checking](https://developers.weixin.qq.com/miniprogram/dev/api/signature.html)

Expand Down Expand Up @@ -750,7 +760,13 @@ class WechatsController < ActionController::Base

# When user sends a voice
on :voice do |request|
request.reply.voice(request[:MediaId]) # Echo the sent voice to user
# Echo the sent voice to user
# request.reply.voice(request[:MediaId])

voice_id = request[:MediaId]
# It's only avaiable for Service Account and enable it in dashboard.
recognition = request[:Recognition]
request.reply.text "#{voice_id} #{recognition}"
end

# When user sends a video
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.2
0.11.3

0 comments on commit 0392c1f

Please sign in to comment.