feat: add mic gain set and get methods

This commit is contained in:
Andrew 2026-04-23 17:14:17 +07:00
parent a740475d56
commit 7608d79d64
8 changed files with 83 additions and 8 deletions

View file

@ -227,6 +227,23 @@ public class LiblinphoneFlutterPlugin: NSObject, FlutterPlugin {
case "stopCallService":
result(true)
case "setMicGain":
guard let args = call.arguments as? [String: Any],
let level = args["level"] as? String else {
result(FlutterError(
code: "INVALID_ARGUMENTS",
message: "Missing required arguments",
details: nil
))
return
}
linphoneBridge.setMicGain(level: level)
result(success)
case "getMicGain":
result(linphoneBridge.getMicGain())
default:
result(FlutterMethodNotImplemented)
}

View file

@ -272,6 +272,14 @@ class LinphoneBridge {
onRegistrationStateChanged(registrationState.rawValue)
onCallStateChanged(callState.rawValue)
}
func setMicGain(level: Float) {
core.micGainDb = level
}
func getMicGain() -> Float {
return core.micGainDb
}
}
// MARK: - CoreDelegate