Speech Recognition Messages
Back

From WeChat Official Account Admin Platform
Jump to: navigation, search

When the speech recognition feature is enabled, WeChat system adds a Recognition field in the XML data package of the pushed audio message each time a user sends audio messages to an official account. Note: Enabling or disabling the speech recognition feature takes effect immediately for new followers and 24 hours for existing followers. Developers can unfollow and then follow in order to test this feature. An example of an audio XML packet is shown as below after the speech recognition feature is enabled:

<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1357290913</CreateTime>
<MsgType><![CDATA[voice]]></MsgType>
<MediaId><![CDATA[media_id]]></MediaId>
<Format><![CDATA[Format]]></Format>
<Recognition><![CDATA[WeChat Team]]></Recognition>
<MsgId>1234567890123456</MsgId>
</xml>

Parameter Description

Parameter Description
ToUserName Developer's WeChat ID
FromUserName Unique sender ID (an OpenID)
CreateTime Message creation time (Integer)
MsgType Voice
MediaID An audio message media ID that can call the download API to load the media file
Format Audio format: amr
Recognition Speech recognition result (UTF8)
MsgID Message ID (64 bit integer)
Developer Guide
Custom-defined Menu
WeChat JS-SDK