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}'); }