修复对讲发送录音帧序号不连续的问题
This commit is contained in:
parent
cbdcdab317
commit
b51a53a9bd
@ -202,6 +202,8 @@ class LockMonitoringLogic extends BaseGetXController {
|
||||
state.isButtonDisabled.value = true;
|
||||
try {
|
||||
await state.voiceProcessor?.stop();
|
||||
state.voiceProcessor?.removeFrameListener(_onFrame);
|
||||
state.udpSendDataFrameNumber = 0;
|
||||
} on PlatformException catch (ex) {
|
||||
state.errorMessage.value = "Failed to stop recorder: $ex";
|
||||
} finally {
|
||||
@ -294,7 +296,7 @@ class LockMonitoringLogic extends BaseGetXController {
|
||||
topBytes[7] = ((state.udpSendDataFrameNumber & 0x0000FF00) >> 8);
|
||||
|
||||
// print(
|
||||
// "udpSendDataFrameNumber:${state.udpSendDataFrameNumber} topBytes[63]:${topBytes[6]} topBytes[64]:${topBytes[7]}");
|
||||
// "udpSendDataFrameNumber:${state.udpSendDataFrameNumber} topBytes[63]:${topBytes[6]} topBytes[64]:${topBytes[7]}");
|
||||
topBytes.addAll(bytes);
|
||||
Get.log("G711编码后为:$topBytes");
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ class LockMonitoringState {
|
||||
var listAudioData = <int>[].obs; //得到的音频流字节数据
|
||||
|
||||
//录音相关
|
||||
late final VoiceProcessor? voiceProcessor;
|
||||
late VoiceProcessor? voiceProcessor;
|
||||
var isProcessing = false.obs; //是否正在处理音频数据
|
||||
var isButtonDisabled = false.obs; //是否禁用按钮
|
||||
final int frameLength = 320; //音视频帧长度为320
|
||||
|
||||
@ -151,7 +151,7 @@ class CallTalk {
|
||||
FlutterPcmSound.pause();
|
||||
FlutterPcmSound.clear();
|
||||
FlutterPcmSound.stop();
|
||||
print('已停止播放声音');
|
||||
// print('已停止播放声音');
|
||||
|
||||
iframe = IframeInfo();
|
||||
iframe!.iframeIndex = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user