明确语音传输格式

This commit is contained in:
2025-10-12 21:46:13 +08:00
parent c418b4c851
commit 978f41340a

View File

@@ -46,7 +46,7 @@ public class WhisperClient {
.setType(MultipartBody.FORM) .setType(MultipartBody.FORM)
.addFormDataPart("model", MODEL) .addFormDataPart("model", MODEL)
.addFormDataPart("file", audioFile.getName(), .addFormDataPart("file", audioFile.getName(),
RequestBody.create(audioFile, MediaType.parse("audio/*"))); RequestBody.create(audioFile, MediaType.parse("audio/webm")));
// 添加可选参数 // 添加可选参数
if (options != null) { if (options != null) {
for (Map.Entry<String, String> entry : options.entrySet()) { for (Map.Entry<String, String> entry : options.entrySet()) {
@@ -69,8 +69,6 @@ public class WhisperClient {
", 详情: " + responseBody ", 详情: " + responseBody
); );
} }
// 解析JSON响应
JSONObject json = new JSONObject(responseBody);
return responseBody; return responseBody;
} }
} }