修复对讲发送录音帧序号不连续的问题

This commit is contained in:
Daisy 2024-04-12 15:23:04 +08:00
parent cbdcdab317
commit b51a53a9bd
3 changed files with 5 additions and 3 deletions

View File

@ -202,6 +202,8 @@ class LockMonitoringLogic extends BaseGetXController {
state.isButtonDisabled.value = true; state.isButtonDisabled.value = true;
try { try {
await state.voiceProcessor?.stop(); await state.voiceProcessor?.stop();
state.voiceProcessor?.removeFrameListener(_onFrame);
state.udpSendDataFrameNumber = 0;
} on PlatformException catch (ex) { } on PlatformException catch (ex) {
state.errorMessage.value = "Failed to stop recorder: $ex"; state.errorMessage.value = "Failed to stop recorder: $ex";
} finally { } finally {

View File

@ -26,7 +26,7 @@ class LockMonitoringState {
var listAudioData = <int>[].obs; // var listAudioData = <int>[].obs; //
// //
late final VoiceProcessor? voiceProcessor; late VoiceProcessor? voiceProcessor;
var isProcessing = false.obs; // var isProcessing = false.obs; //
var isButtonDisabled = false.obs; // var isButtonDisabled = false.obs; //
final int frameLength = 320; //320 final int frameLength = 320; //320

View File

@ -151,7 +151,7 @@ class CallTalk {
FlutterPcmSound.pause(); FlutterPcmSound.pause();
FlutterPcmSound.clear(); FlutterPcmSound.clear();
FlutterPcmSound.stop(); FlutterPcmSound.stop();
print('已停止播放声音'); // print('已停止播放声音');
iframe = IframeInfo(); iframe = IframeInfo();
iframe!.iframeIndex = 0; iframe!.iframeIndex = 0;