# Introduction to Weixin AI Open APIs

Weixin AI APIs are AI open APIs jointly launched by the Weixin iHearing Voice Team, the Weixin Translate Team, and the Official Accounts Platform. Currently the voice-to-text converting and text translation APIs are available to empower developer AI.

Voice-to-text conversion API

Provides voice-to-text conversion services for Chinese (Mandarin) and English.

Text translation API

Provides text translation services for English to Chinese and Chinese to English.

# Target Users

Apps registered on Official Accounts, Mini Programs, and the Weixin Open Platform.

# Use Samples

Weixin Voice-to-text Conversion

Weixin Translate

Weixin Face-to-face Translation Mini Program

# API Documentation - Submitting the Voice

API Request Format

HTTP request method: POST
http://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?access_token=ACCESS_TOKEN&format=&voice_id=xxxxxx&lang=zh_CN

Parameters

Parameter Required Description
access_token Yes API call credentials
format Yes File format (Only supports mp3 files with 16 kHz sampling rate, mono track, and maximum size of 1 MB)
voice_id Yes Voice's unique identifier
lang No Language, zh_CN (default) or en_US
Upload a voice file

Response

Example of return result for a successful call:

{"errmsg":"ok","errcode":"0"}

# API Documentation - Obtaining the Result of Voice Recognition

API Request Format

HTTP request method: POST
http://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=xxxxxx&lang=zh_CN

Note that the API should be called within 10 seconds after a file is added.

Parameters

Parameter Required Description
access_token Yes API call credential
voice_id Yes Voice's unique identifier
lang No Language, zh_CN (default) or en_US

Response

Example of return result for a successful call:

{"result":"xxxxxxxxxxxxxxxxxx"}

# API Documentation - Weixin Translate

API Request Format

HTTP request method: POST
http://api.weixin.qq.com/cgi-bin/media/voice/translatecontent?access_token=ACCESS_TOKEN&lfrom=xxx&lto=xxx

Parameters

Parameter Required Description
access_token Yes API call credentials
lfrom Yes Source language, zh_CN or en_US
lto Yes Target language, zh_CN or en_US
Upload a voice file (in the utf8 format, with a maximum of 600 bytes)

Response

Example of return result for a successful call:

{"from_content":"xxxxxxxx", "to_content":"xxxxxxxx"}	

# About Us

Weixin Translate

Weixin Translate is a new machine translation engine launched by the Weixin AI Team in 2017, which is developed based on the industry's most advanced neural machine translation technology. Weixin Translate now supports English-Chinese and Chinese-English translation, both with an industry-leading level of translation quality. It is applied in Weixin chat translation and Moments post translation, and will be used in more scenarios to provide high-quality translation services for hundreds of millions of Weixin users, delivering barrier-free cross-language communication experience.

Weixin iHearing Voice

Weixin iHearing is a voice recognition technology developed independently by the Weixin AI Team based on the deep learning theory. Since 2013, Weixin iHearing has been used in dozens of Tencent products such as Weixin, QQ, Games, and Search, serving hundreds of millions of Tencent users. Having been tested by the vast number of users, it is now a general voice recognition technology leading in the industry. With the continuous advancement of technology in recent years, Weixin iHearing has enabled more application scenarios, such as the on-site simultaneous interpretation service launched with Mr. Translator, and the call center quality inspection service, audio keyword search service, English pronunciation evaluation service, as well as intelligent hardware voice platform Xiaowei for far-field environments jointly launched with Tencent Cloud, delivering high-quality voice recognition services for individual and enterprise users. In a word, Weixin iHearing empowers users' communication.