# Android Voice Capture

Record audio, configure its duration, and handle capture results.

## Scope and provenance

- Product: mobile
- Status: Imported reference snapshot. Import date is not a verification date or guarantee of current release support.
- SDK version: 11.1.13.2.18
- Environment: Page-specific. Confirm the environment host, credentials, and service configuration; do not infer them from another product.
- Source: https://gitlab.idmission.com/apps/sdk2.0/android/idmissionandroidsdk/-/blob/main/idmission-capture/src/fullsdk/java/com/idmission/sdk2/identityproofing/IdentityProofingSDK.kt
- Imported at: 2026-10-04T00:00:00.000Z
- Canonical page: https://docs.idmission.com/mobile/android-voice-capture
- Agent index: https://docs.idmission.com/llms.txt

---

<a id="scope-and-prerequisites"></a>

## Scope and prerequisites

This reference was checked against IDmission Android SDK **11.1.13.2.18** from the supplied `IdmissionAndroidSDK` source archive. It describes that version's implementation; it is not a live-generated reference.

Initialize the SDK successfully before starting voice capture. See [Android SDK setup](https://docs.idmission.com/markdown/mobile/android-sdk-2.md). Capture uses the microphone and requests Android's `RECORD_AUDIO` permission.

The `voiceCapture` entry point exists in the Full, Medium, Lite, Liveness, and Video ID source variants, including their without-models variants.

<a id="method-and-parameters"></a>

## Method and parameters

```kotlin
IdentityProofingSDK.voiceCapture(activity)
IdentityProofingSDK.voiceCapture(activity, sdkCustomizationOptions)
```

Both overloads return `com.idmission.sdk2.client.model.Response<String>`. The immediate response reports whether capture was started; the recorded audio arrives later through the activity result.

| Parameter                 | Type                       | Required | Behavior                                                                  |
| ------------------------- | -------------------------- | -------- | ------------------------------------------------------------------------- |
| `activity`                | `android.app.Activity`     | Yes      | The current activity used to launch voice capture and receive its result. |
| `sdkCustomizationOptions` | `SDKCustomizationOptions?` | No       | Set `voiceCaptureCustomizationOptions` to customize the recording limit.  |

Most variants default the optional argument to `null`, which gives voice capture its default recording limit. The Medium-without-models and Liveness-without-models source variants instead default to the handler's current customization options. Pass options explicitly when consistent behavior across variants matters.

<a id="recording-duration"></a>

## Recording duration

`VoiceCaptureCustomizationOptions` has one property in this version:

| Property                 | Type  | Default | Actual unit |
| ------------------------ | ----- | ------- | ----------- |
| `recordingTimeInMinutes` | `Int` | `15`    | **Seconds** |

Despite the property's name and one source comment referring to minutes, the implementation passes this value directly to a seconds-based timer. A value of `30` means a 30-second recording limit. Keep the existing property name in your integration.

Inside your activity, after successful SDK initialization:

```kotlin
import com.idmission.sdk2.client.model.SDKCustomizationOptions
import com.idmission.sdk2.client.model.VoiceCaptureCustomizationOptions
import com.idmission.sdk2.identityproofing.IdentityProofingSDK

val response = IdentityProofingSDK.voiceCapture(
    this,
    SDKCustomizationOptions(
        voiceCaptureCustomizationOptions = VoiceCaptureCustomizationOptions(
            recordingTimeInMinutes = 30 // Seconds in SDK 11.1.13.2.18.
        )
    )
)

if (response.errorStatus?.statusCode != 0) {
    // Show response.errorStatus?.statusMessage in your UI.
    // Capture did not start.
}
```

<a id="start-response"></a>

## Start response

Read `response.errorStatus?.statusCode`. In this SDK, the field named `errorStatus` also carries the successful launch status.

| Status | Meaning                                                                   |
| ------ | ------------------------------------------------------------------------- |
| `0`    | Capture activity launched. This does not mean a recording has been saved. |
| `1`    | SDK initialization is required.                                           |
| `10`   | Device is not supported.                                                  |

<a id="capture-result"></a>

## Capture result

The SDK uses `startActivityForResult`; receive the recording in your activity's `onActivityResult`. Use the SDK constants instead of duplicating their numeric values.

```kotlin
import android.app.Activity
import android.content.Intent
import com.idmission.sdk2.capture.util.CaptureConstants

override fun onActivityResult(
    requestCode: Int,
    resultCode: Int,
    data: Intent?
) {
    super.onActivityResult(requestCode, resultCode, data)

    if (requestCode != CaptureConstants.VOICE_CAPTURE_REQUEST_CODE) return

    when (resultCode) {
        Activity.RESULT_OK -> {
            val audioBase64 =
                data?.getStringExtra(CaptureConstants.VOICE_CAPTURE_DATA)
            val temporaryFilePath =
                data?.getStringExtra(CaptureConstants.VOICE_CAPTURE_FILE_PATH)

            // Use the saved recording in your integration.
        }
        CaptureConstants.OPERATION_CANCEL, Activity.RESULT_CANCELED -> {
            // Return your UI to its idle state.
        }
    }
}
```

| Result extra                               | Type     | Meaning                               |
| ------------------------------------------ | -------- | ------------------------------------- |
| `CaptureConstants.VOICE_CAPTURE_DATA`      | `String` | Base64-encoded recorded audio.        |
| `CaptureConstants.VOICE_CAPTURE_FILE_PATH` | `String` | Path to the temporary recording file. |

Saving also stores the Base64 audio in the SDK cache through `setVoiceData`. The capture method itself does not submit an identity-verification request.

The supplied implementation records **AAC audio in an MPEG-4 container**, but creates the temporary file with a `.mp3` extension. Do not infer the actual audio format from that extension.

<a id="source-and-updates"></a>

## Source and updates

Verified on 2026-10-04 against SDK 11.1.13.2.18. The implementation lives in GitLab project 220, `apps/sdk2.0/android/idmissionandroidsdk`:

- Flavor-specific `IdentityProofingSDK.kt`: public overloads and default arguments.
- `IdentityProofingSDKHandler.kt`: initialization checks, launch behavior, and immediate response.
- `VoiceCaptureCustomizationOptions.kt` and `DetectionConfig.kt`: duration option and default.
- `VoiceCaptureActivity.kt` and `VoiceCaptureBottomSheet.kt`: permission request, seconds-based timer, audio format, and result extras.

GitLab source access requires an IDmission account with repository permission. This page must be reviewed when the Android SDK changes; importing the older published guides does not update it automatically.
