openLocalMicrophone method

Future<TUIActionCallback> openLocalMicrophone()

Implementation

Future<TUIActionCallback> openLocalMicrophone() async {
  var isGranted = await Permission.microphone.isGranted;

  if (!isGranted) {
    var microphone = await Permission.microphone.request();
    if (!microphone.isGranted) {
      return TUIActionCallback(
          code: TUIError.errPermissionDenied,
          message: "camera permission denied");
    }
  }
  var result = await _roomEngine
      .openLocalMicrophone(TUIAudioQuality.audioProfileDefault);
  if (result.code == TUIError.success) {
    RoomStore.to.audioSetting.isMicDeviceOpened = true;
  }
  return result;
}