This commit is contained in:
sky.min 2026-01-14 16:05:50 +08:00
parent 203377f6ca
commit 6542f27437
4 changed files with 26 additions and 22 deletions

View File

@ -76,9 +76,6 @@ class ImageTransmissionLogic extends BaseGetXController {
//
StartChartManage().startTalkRejectMessageTimer();
}
//
await Future.delayed(Duration(milliseconds: 500));
StartChartManage().destruction();
Get.back();
}

View File

@ -111,6 +111,9 @@ class TalkViewNativeDecodeState {
final List<Map<String, dynamic>> h264FrameBuffer = <Map<String, dynamic>>[]; // H264帧缓冲区
int maxFrameBufferSize = 3; //
final int targetFps = 25; // ,native的缓冲区
final int adaptiveBufferSizeMin = 2; //
final int adaptiveBufferSizeMax = 6; //
final int networkQualityCheckIntervalMs = 2000; // ()
final int frameProcessIntervalMs = 10; // ()
Timer? frameProcessTimer; //
bool isProcessingFrame = false; //
@ -126,4 +129,4 @@ class TalkViewNativeDecodeState {
//
RxBool isFullScreen = false.obs;
}
}

View File

@ -646,15 +646,7 @@ class TalkViewLogic extends BaseGetXController {
//
Future<void> _onFrame(List<int> frame) async {
// iOS端发送音频过强导致锁端接收音量相对变小
double gainFactor = 1.0; //
if (Platform.isAndroid) {
gainFactor = 1.2; // Android端适当增强
} else if (Platform.isIOS) {
gainFactor = 0.8; // iOS端降低增益使
}
final applyGain = _applyGain(frame, gainFactor);
final applyGain = _applyGain(frame, 1.6);
// G711数据
List<int> encodedData = G711Tool.encode(applyGain, 0); // 0A-law

View File

@ -445,15 +445,8 @@ class H264WebViewLogic extends BaseGetXController {
return;
}
// iOS端发送音频过强导致锁端接收音量相对变小
double gainFactor = 1.0; //
if (Platform.isAndroid) {
gainFactor = 1.2; // Android端适当增强
} else if (Platform.isIOS) {
gainFactor = 0.8; // iOS端降低增益使
}
List<int> amplifiedFrame = _applyGain(frame, gainFactor);
//
List<int> amplifiedFrame = _applyGain(frame, 1.8);
// G711数据
List<int> encodedData = G711Tool.encode(amplifiedFrame, 0); // 0A-law
_bufferedAudioFrames.addAll(encodedData);
@ -511,6 +504,25 @@ class H264WebViewLogic extends BaseGetXController {
return result;
}
//
List<int> _applyDenoise(List<int> pcmData) {
// 使
const int noiseThreshold = 150; //
List<int> result = List<int>.filled(pcmData.length, 0);
for (int i = 0; i < pcmData.length; i++) {
// 0
if (pcmData[i].abs() < noiseThreshold) {
result[i] = 0;
} else {
result[i] = pcmData[i];
}
}
return result;
}
///
void udpHangUpAction() async {
if (state.talkStatus.value == TalkStatus.answeredSuccessfully) {