public class WxMpAiOpenServiceImpl extends Object implements WxMpAiOpenService
| 构造器和说明 |
|---|
WxMpAiOpenServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
queryRecognitionResult(String voiceId,
AiLangType lang)
获取语音识别结果
请注意,添加完文件之后10s内调用这个接口
|
String |
recogniseVoice(String voiceId,
AiLangType lang,
File voiceFile)
识别指定语音文件内容
此方法揉合了前两两个方法:uploadVoice 和 queryRecognitionResult
|
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提交语音
uploadVoice 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文voiceFile - 语音文件WxErrorException - 微信API调用异常,可能包括:
public String queryRecognitionResult(String voiceId, AiLangType lang) throws WxErrorException
WxMpAiOpenService获取语音识别结果 请注意,添加完文件之后10s内调用这个接口
queryRecognitionResult 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文WxErrorException - 微信API调用异常,可能包括:
public String recogniseVoice(String voiceId, AiLangType lang, File voiceFile) throws WxErrorException
WxMpAiOpenService识别指定语音文件内容 此方法揉合了前两两个方法:uploadVoice 和 queryRecognitionResult
recogniseVoice 在接口中 WxMpAiOpenServicevoiceId - 语音唯一标识lang - 语言,zh_CN 或 en_US,默认中文voiceFile - 语音文件WxErrorException - 微信API调用异常,可能包括:
public String translate(AiLangType langFrom, AiLangType langTo, String content) throws WxErrorException
WxMpAiOpenService微信翻译
translate 在接口中 WxMpAiOpenServicelangFrom - 源语言,zh_CN 或 en_USlangTo - 目标语言,zh_CN 或 en_UScontent - 要翻译的文本内容WxErrorException - 微信API调用异常,可能包括:
Copyright © 2026. All rights reserved.