public class WxMpAiOpenServiceImpl extends Object implements WxMpAiOpenService
Created by BinaryWang on 2018/6/9.
| 构造器和说明 |
|---|
WxMpAiOpenServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
queryRecognitionResult(String voiceId,
AiLangType lang)
获取语音识别结果.
|
String |
recogniseVoice(String voiceId,
AiLangType lang,
File voiceFile)
识别指定语音文件内容.
|
String |
translate(AiLangType langFrom,
AiLangType langTo,
String content)
微信翻译.
|
void |
uploadVoice(String voiceId,
AiLangType lang,
File voiceFile)
提交语音.
|
public void uploadVoice(String voiceId, AiLangType lang, File voiceFile) throws WxErrorException
WxMpAiOpenService提交语音. http请求方式: POST http://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?access_token=ACCESS_TOKEN&format=&voice_id=xxxxxx&lang=zh_CN
uploadVoice 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文voiceFile - 语音文件WxErrorException - the wx error exceptionpublic String recogniseVoice(String voiceId, AiLangType lang, File voiceFile) throws WxErrorException
WxMpAiOpenServicerecogniseVoice 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文voiceFile - 语音文件WxErrorException - the wx error exceptionpublic String translate(AiLangType langFrom, AiLangType langTo, String content) throws WxErrorException
WxMpAiOpenService微信翻译. 接口调用请求说明 http请求方式: POST http://api.weixin.qq.com/cgi-bin/media/voice/translatecontent?access_token=ACCESS_TOKEN&lfrom=xxx<o=xxx
translate 在接口中 WxMpAiOpenServicelangFrom - 源语言,zh_CN 或 en_USlangTo - 目标语言,zh_CN 或 en_UScontent - 要翻译的文本内容WxErrorException - the wx error exceptionpublic String queryRecognitionResult(String voiceId, AiLangType lang) throws WxErrorException
WxMpAiOpenService获取语音识别结果. 接口调用请求说明 http://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=xxxxxx&lang=zh_CN 请注意,添加完文件之后10s内调用这个接口
queryRecognitionResult 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文WxErrorException - the wx error exceptionCopyright © 2024. All rights reserved.