我用事例的语音文件都识别不了
音频文件:http://liqiansunvoice-1255628450.cosgz.myqcloud.com/demo.mp3
代码:
Credential cred = new Credential(TXYUNAPI_SECRET_ID, TXYUNAPI_SECRET_KEY);
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("aai.tencentcloudapi.com");
httpProfile.setReqMethod("GET");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
AaiClient client = new AaiClient(cred, "ap-shanghai", clientProfile);
JSONObject json = new JSONObject();
json.put("ProjectId", 0);
json.put("SubServiceType", 2);
json.put("EngSerViceType", "8k");
json.put("SourceType", 0);
json.put("VoiceFormat", "mp3");
json.put("UsrAudioKey", UUID.randomUUID().toString());
json.put("Url", mp3Url);
String params = json.toJSONString();
SentenceRecognitionRequest req = SentenceRecognitionRequest.fromJsonString(params, SentenceRecognitionRequest.class);
SentenceRecognitionResponse resp = client.SentenceRecognition(req);
System.out.println(SentenceRecognitionRequest.toJsonString(resp));
相似问题