提交代码

This commit is contained in:
魏少阳 2023-12-25 10:45:07 +08:00
parent 01f5b67375
commit 82b110778d
5 changed files with 13 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -633,8 +633,7 @@ class LockDetailLogic extends BaseGetXController{
print("有蓝牙权限开始扫描");
startScanAction();
}else{
getMicrophonePermission()
.then((value) {
getMicrophonePermission().then((value) {
if (value) {
//
print("有蓝牙权限开始扫描");

View File

@ -65,6 +65,7 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
var saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
Storage.setStringList(saveBlueToken, [0, 0, 0, 0]);
// logic.startScanAction();
listeningAnimations();

View File

@ -28,7 +28,7 @@ class CallTalk {
var growableList;
bool getFirstFrame = false; //
final FlutterSoundPlayer _audioPlayer = FlutterSoundPlayer();
Uint8List? allPcmData = Uint8List(0);
List<int>? allPcmData = [];
CallTalk._init() {
iframe = IframeInfo();
@ -58,11 +58,14 @@ class CallTalk {
print('dinglingling bb.length:${g711Data.length} 音频数据来:$g711Data ');
Uint8List? pcmBytes = await G711().decodeG711ToPCM(g711Data.toList());
allPcmData!.addAll(pcmBytes!);
await Future.delayed(const Duration(seconds: 1));
print('PCM decoded data: $pcmBytes');
if (pcmBytes != null) {
_initializeAudioPlayer();
_playRawData(pcmBytes);
_playRawData(Uint8List.fromList(allPcmData!));
} else {
print('Error decoding G.711 to PCM');
}
@ -163,4 +166,8 @@ class CallTalk {
},
);
}
Future<void> stopLocalAudio() async {
await _audioPlayer.stopPlayer();
}
}

View File

@ -19,7 +19,7 @@ class CommandUDPReciverManager {
if (dataSize < 4) {
return;
}
// print("appReceiveUDPData:$data");
print("appReceiveUDPData:$data");
Uint8List data1 = Uint8List.fromList(data);
if (data1.length == 1) {