SpeechTilesAndamento Docs
Get started
SDK Reference · Method

requestMicrophonePermission

Requests microphone permission through the underlying media layer.

Declaration

public func requestMicrophonePermission() -> STResult

Overview

Requests the operating system’s microphone permission. If the result is .permissionPending, the user has not yet made a decision; observe the media event reporting .permissionGranted or .permissionDenied before starting microphone capture.

Pending permission

The underlying media API can return .permissionPending while the operating-system permission request is still awaiting the user's decision. The Conversation runner returns that result to the caller; the eventual resolved microphone status is delivered through conversationReceivedPermissionResult(permission:status:).

A pending result should therefore not be presented to the application user as a final denial.

Permission response

Request submission and the operating-system permission decision are separate. Observe the framework permission callback or event rather than interpreting request success as authorization.

Usage example

_ = conversation.requestMicrophonePermission()

Result handling

This method returns an STResult. Check the returned value for success or failure.

Application Configuration — macOS

In Xcode, open Application Target → Info → Custom macOS Application Target Properties and add Privacy - Microphone Usage Description (NSMicrophoneUsageDescription). Provide a user-facing explanation, such as: “This application needs permission to record speech during voice interactions.”

The usage-description property is required for the system permission request; adding it does not itself grant permission. When authorization has not previously been decided, macOS may display a permission dialog. The request remains pending until the system reports the user’s grant or denial through the documented permission callback or event. When a decision already exists, macOS may return that status without displaying another dialog.

For sandboxed macOS applications, enable Signing & Capabilities → App Sandbox → Hardware → Audio Input when microphone input is required.

See Also