From 69ae1c3adcafa847b1df13bb2a341c4c001f2437 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Thu, 4 Dec 2025 11:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A3=B0=E9=9F=B3=E5=A4=8D?= =?UTF-8?q?=E5=88=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../voice_replication/views/recorder_bottom_sheet.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/modules/voice_replication/views/recorder_bottom_sheet.dart b/lib/modules/voice_replication/views/recorder_bottom_sheet.dart index 82eb7f25a..9bbbbc8a4 100644 --- a/lib/modules/voice_replication/views/recorder_bottom_sheet.dart +++ b/lib/modules/voice_replication/views/recorder_bottom_sheet.dart @@ -115,6 +115,7 @@ class _RecorderBottomSheetState extends State { request.fields['locale'] = 'zh-CN'; request.files.add(await http.MultipartFile.fromPath('audiodata', _path)); + final streamed = await request.send(); final response = await http.Response.fromStream(streamed); if (streamed.statusCode < 200 || streamed.statusCode >= 300) { @@ -132,6 +133,9 @@ class _RecorderBottomSheetState extends State { request.fields['consentId'] = _jessicaConsentId; request.files.add(await http.MultipartFile.fromPath('audiodata', _path)); + request.files.add(await http.MultipartFile.fromPath('audiodata', + '/data/user/0/com.saitong.voitrans/app_flutter/VoiceReplication/recording_1764763812656.wav')); + final streamed = await request.send(); final response = await http.Response.fromStream(streamed); if (streamed.statusCode >= 200 && streamed.statusCode < 300) { @@ -144,6 +148,11 @@ class _RecorderBottomSheetState extends State { _storage.write('speakerProfileId', decoded['speakerProfileId']); } } else { + final bodyText = utf8.decode(response.bodyBytes, allowMalformed: true); + if (bodyText.isNotEmpty) { + final decoded = jsonDecode(bodyText); + print('------2-------$decoded'); + } throw Exception( 'Failed to create personal voice: ${response.statusCode}'); }