PlanetKitAudioMicControllable
@objc
public protocol PlanetKitAudioMicControllable
A class that represents the audio microphone management for PlanetKit.
-
Indicates whether the VoiceProcessingIO is enabled.
Remark
This value will be modified during call setup by our service configuration. If you want to override our suggested configuration, you should callwithIgnoreVpioServiceConfigKey(ignore:)
.Declaration
Swift
var vpioEnabled: Bool { get set }
-
Indicates whether the microphone is enabled.
Declaration
Swift
var micEnabled: Bool { get set }
-
Indicates whether the microphone is opened.
Declaration
Swift
var isOpened: Bool { get }
-
Indicates whether the microphone is started.
Declaration
Swift
var isStarted: Bool { get }
-
Opens the microphone.
Declaration
Swift
func open()
-
Starts the microphone.
Declaration
Swift
func start()
-
Stops the microphone.
Declaration
Swift
func stop()
-
Closes the microphone.
Declaration
Swift
func close()
-
Executes an asynchronous closure using the internal audio queue.
Declaration
Swift
func async(completion: @escaping () -> Void)
Parameters
completion
The closure to be executed asynchronously.
-
Represents the currently used microphone device.
-
Provides device type information to PlanetKit, indicating if it is a real device or a virtual device.
Remark
If this device instance is a virtual device, meaning it does not use a physical audio microphone, thenisVirtualDevice
should return true. It should returnfalse
when your custom device uses PlanetKit’s default audio device likePlanetKitAudio.spk
orPlanetKitAudio.mic
without changing the system’s default device.This value will affect the reset of VQE (Voice Quality Enhancement) if this device is a real device.
Declaration
Swift
var isVirtualDevice: Bool { get }
-
Adds a receiver for the microphone capture.
Declaration
Swift
func addMicReceiver(_ micReceiver: PlanetKitAudioMicCaptureDelegate)
Parameters
micReceiver
The receiver for the microphone capture.
-
Removes a receiver for the microphone capture.
Declaration
Swift
func removeMicReceiver(_ micReceiver: PlanetKitAudioMicCaptureDelegate)
Parameters
micReceiver
The receiver for the microphone capture.
-
Sets the modifier for the microphone capture.
Remark
ThemicModifier
is used to modify the microphone audio data before it is sent to the remote peer.Declaration
Swift
weak var micModifier: PlanetKitAudioMicCaptureDelegate? { get set }
-
Sets the private delegate for the microphone capture.
Remark
ThemicPrivateDelegate
is primarily used by PlanetKitCall or PlanetKitConference to send audio data from the microphone and provide data for the remote users.Declaration
Swift
weak var micPrivateDelegate: PlanetKitAudioMicCaptureDelegate? { get set }
-
Sets the receiver for the microphone volume level.
Remark
ThemicVolumeReceiver
is used to receive the microphone volume level at everymicVolumeInterval
seconds. The volume level ranges between 0.0 and 1.0.Declaration
Swift
weak var micVolumeReceiver: PlanetKitAudioDeviceVolumeDelegate? { get set }
-
The interval at which the microphone volume level is received.
Remark
ThemicVolumeReceiver
will receive the microphone volume level at everymicVolumeInterval
seconds. The volume level ranges between 0.0 and 1.0.Declaration
Swift
var micVolumeInterval: TimeInterval { get set }