public interface WxMpAiOpenService
微信AI开放接口(语音识别,微信翻译). https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21516712282KzWVE Created by BinaryWang on 2018/6/9.
限定符和类型 | 方法和说明 |
---|---|
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)
提交语音.
|
void uploadVoice(String voiceId, AiLangType lang, File voiceFile) throws WxErrorException
提交语音. http请求方式: POST http://api.weixin.qq.com/cgi-bin/media/voice/addvoicetorecofortext?access_token=ACCESS_TOKEN&format=&voice_id=xxxxxx&lang=zh_CN
voiceId
- 语音唯一标识lang
- 语言,zh_CN 或 en_US,默认中文voiceFile
- 语音文件WxErrorException
- the wx error exceptionString queryRecognitionResult(String voiceId, AiLangType lang) throws WxErrorException
获取语音识别结果. 接口调用请求说明 http://api.weixin.qq.com/cgi-bin/media/voice/queryrecoresultfortext?access_token=ACCESS_TOKEN&voice_id=xxxxxx&lang=zh_CN 请注意,添加完文件之后10s内调用这个接口
voiceId
- 语音唯一标识lang
- 语言,zh_CN 或 en_US,默认中文WxErrorException
- the wx error exceptionString recogniseVoice(String voiceId, AiLangType lang, File voiceFile) throws WxErrorException
voiceId
- 语音唯一标识lang
- 语言,zh_CN 或 en_US,默认中文voiceFile
- 语音文件WxErrorException
- the wx error exceptionString translate(AiLangType langFrom, AiLangType langTo, String content) throws WxErrorException
微信翻译. 接口调用请求说明 http请求方式: POST http://api.weixin.qq.com/cgi-bin/media/voice/translatecontent?access_token=ACCESS_TOKEN&lfrom=xxx<o=xxx
langFrom
- 源语言,zh_CN 或 en_USlangTo
- 目标语言,zh_CN 或 en_UScontent
- 要翻译的文本内容WxErrorException
- the wx error exceptionCopyright © 2024. All rights reserved.