SpeechTilesAndamento Docs
Get started
SDK Reference · Method

requestMicrophonePermission

Requests permission to capture audio from the device microphone.

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.

Prerequisite

The audio-recorder component must be initialized.

Return value

The permission request can return .permissionGranted, .permissionDenied, or .permissionPending. .permissionPending indicates that the operating-system permission decision is still being presented to the user; the eventual decision is reported through a media event.

Returns .audioRecorderNotInitialized when the recorder is unavailable.

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