Commit e246480e authored by 赵啸非's avatar 赵啸非

修改音频识别结果

parent 01d4dea7
......@@ -97,17 +97,18 @@ public class ApiSendMsgController {
String jsonStr = "";
try {
if (file == null || file.getSize() == 0L) throw new AppException("文件为空!");
if (!"pcm".equalsIgnoreCase(FileUtil.getSuffix(file.getOriginalFilename())))
throw new AppException("只支持pcm!");
//if (file.getOriginalFilename())
String filePath = uploadService.saveFileUpload(file, prePath, null);
filePath = uploadService.getFilePath(filePath);
log.info("filePath==>" + filePath);
// byte[] bytes = file.getBytes();
IatModelMulUtil iatModelMulUtil = new IatModelMulUtil(filePath, appid);
// if (!"pcm".equalsIgnoreCase(FileUtil.getSuffix(file.getOriginalFilename())))
// throw new AppException("只支持pcm!");
// //if (file.getOriginalFilename())
// String filePath = uploadService.saveFileUpload(file, prePath, null);
// filePath = uploadService.getFilePath(filePath);
//
// log.info("filePath==>" + filePath);
byte[] bytes = file.getBytes();
// IatModelMulUtil iatModelMulUtil = new IatModelMulUtil(filePath, appid);
IatModelMulUtil iatModelMulUtil = new IatModelMulUtil(bytes, appid);
String authUrl = IatModelMulUtil.getAuthUrl(hostUrl, apiKey, apiSecret);
//log.info("authUrl==>" + authUrl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment