Android Voice Capture
Record audio, configure its duration, and handle capture results.
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. 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.
Method and parameters
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.
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:
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.
}
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. |
Capture result
The SDK uses startActivityForResult; receive the recording in your activity's onActivityResult. Use the SDK constants instead of duplicating their numeric values.
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.
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.ktandDetectionConfig.kt: duration option and default.VoiceCaptureActivity.ktandVoiceCaptureBottomSheet.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.
Report a docs issue
Copy this context into your team’s issue tracker or an email to support@idmission.com.
