openAndroidMicrophone

fun openAndroidMicrophone(options: MicrophoneOptions, audioSource: Int, sampleRateHz: Int = options.preferredSampleRateHz ?: 16_000, channelCount: Int = options.preferredChannelCount ?: 1, unsupportedOpusMessage: String = "Android microphone: OPUS not supported", unsupportedChannelMessage: (Int) -> String = { "Android microphone: channelCount=$it" }, minBufferErrorMessage: (Int) -> String = { "AudioRecord.getMinBufferSize failed: $it" }, uninitializedMessage: String = "AudioRecord not initialized", sharedFlowExtraBufferCapacity: Int = 64, sharedFlowOverflow: BufferOverflow = BufferOverflow.SUSPEND, breakOnNegativeRead: Boolean = true, beforeStart: () -> Unit = {}, beforeStop: () -> Unit = {}, afterStop: () -> Unit = {}): Result<MicrophoneSession>