梳理麦克风开闭逻辑2

This commit is contained in:
fuenmao 2024-12-05 12:14:41 +08:00
parent a96c23c2aa
commit cc268cc00d
1 changed files with 4 additions and 7 deletions

View File

@ -283,6 +283,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
state.isSpeak.value = true;
state.isOpenMicrophone.value = true;
setClientRole("主播");
debugPrint("wgs输出===Socket-开启发言权限:主播");
}
}else{
debugPrint("wgs输出===Socket-关闭发言权限:${e?[0]}--${e?[1]}");
@ -297,6 +298,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
state.isSpeak.value = false;
state.isOpenMicrophone.value = false;
setClientRole("观众");
debugPrint("wgs输出===Socket-关闭发言权限:观众");
}
}
doHttpSetMicr();
@ -497,12 +499,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
channelProfile: ChannelProfileType.channelProfileLiveBroadcasting,
));
//
// await state.rctEngine.value?.enableAudio();
//
await state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(false);
//
await state.rctEngine.value?.enableAudioVolumeIndication(interval: 200, smooth: 3, reportVad: true);
//
enableAudio();
joinMeetingToRtc();
@ -644,11 +646,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
await state.rctEngine.value?.setEnableSpeakerphone(mode == 1 ? false : true);
}
///
Future<void> enableAudio() async {
await state.rctEngine.value?.enableAudio();
}
///
Future<void> disableAudio() async {
await state.rctEngine.value?.disableAudio();