Set Up Agentforce Voice for Android
Agentforce Voice lets you build voice-enabled agents that manage complex conversations in real time. Set up Agentforce Voice for your Android mobile app with these steps.
Before you set up Agentforce Voice for your mobile app, create and configure a voice-enabled service agent in Agentforce Studio.
Voice settings are configured at the agent level and apply across all supported connections.
The Agentforce Mobile SDK supports two connection paths for voice. Choose based on your requirements. Both paths require enableVoice: true in your SDK feature flags, configured in the next section.
| Agent API (Telephony) | Enhanced Chat v2 (Service Cloud) | |
|---|---|---|
| Setup | Add a Telephony connection in Agentforce Studio | Create an Embedded Service Deployment with an ECv2 channel |
| Human escalation | Not supported | Supported — agent can hand off to a live agent |
| Transcript logging | Not available | Available through Service Cloud |
| Routing | Direct to agent | Omni-Channel routing with queue fallback |
| Voice mode UI | Always available when voice is enabled | Appears after the agent joins the session |
Use this path for a lightweight integration that gets voice running with minimal server-side configuration. In Agentforce Studio, add a Telephony connection to your service agent to unlock voice settings. This “Agent API” refers to the mobile SDK’s internal connection to the agent — it’s not the same as the Agentforce Agent API used for headless server-to-server integrations. This path doesn’t require a full Service Cloud Voice telephony setup. It just activates the agent-level voice configuration for use with the mobile SDK.
- In Agentforce Studio, open your service agent.
- Go to Connections and click Add.
- Select Telephone and save.
- Configure voice settings (voice persona, language) in the agent’s voice settings panel.
This path enables richer capabilities including human escalation and transcript logging. It requires an Embedded Service Deployment with an ECv2 channel that has voice enabled.
- In Agentforce Studio, open your service agent.
- Go to Connections and click Add.
- Select Enhanced Chat V2, then save and activate.
- Go to the ECv2 connection’s Routing section and create a new channel.
- In the channel settings, select Allow Voice in Enhanced Chat and publish.
- Create a Mobile Embedded Service Deployment using that channel.
For the ECv2 path, use the Service API URL and ES Developer Name from your Embedded Service Deployment when configuring the SDK. See Before You Begin for where to find these values.
For more information, see Connect a Service Agent to Enhanced Chat v2.
After configuring your connection path, install the voice module and set up the client below. The SDK configuration is the same regardless of which path you chose.
Starting with SDK version 260.4, Agentforce Voice is a separate optional module. To use Agentforce Voice, add the agentforce-sdk-voice dependency to your build.gradle file alongside the core SDK.
Then, register the voice module in your configuration:
If you don’t use Agentforce Voice, no changes are needed — voice is no longer bundled with the core SDK by default.
To enable Agentforce Voice for Android in your AgentforceConfiguration, use setFeatureFlagSettings.
To set your permissions manager, use setPermission.
To set your voice manager, use setVoiceManaging.
As of SDK version 262.3, the SDK no longer ships a default implementation of AgentforceVoiceManaging. If you don’t set voiceManaging, no action is needed for basic text-based chat — users can still dictate into the chat input using the platform’s native keyboard mic. See Speech-to-Text Default Removed in 262.3 below for details on what this affects and how to implement your own AgentforceVoiceManaging if you need SDK-managed speech-to-text.
To initialize the AgentforceClient, use the configuration object you created.
To wire the permission manager in your app, add handlePermissionResult from AgentforceDefaultPermissions.
To create a chat container with voice enabled, pass agentforceConversation into the AgentforceConversationContainer.
In voice mode, the agent responds audibly, and the written response is intentionally hidden when closed captions are off. Turning closed captions on displays the live transcript of the agent’s response. Closed captions default to off, so users tap the closed-caption control to turn them on.
If the agent’s written response appears to be missing during a voice conversation, that’s expected behavior when closed captions are off—it’s not a bug. The response is still delivered audibly, and enabling closed captions shows the transcript. Agent responses always remain visible in the standard chat interface.
This section covers the mic used to dictate text into the chat input field, which is separate from the real-time Agent Voice conversation feature described above.
As of SDK version 262.3, the Agentforce Mobile SDK no longer ships a default implementation of the AgentforceVoiceManaging interface. Speech-to-text dictation into the chat input isn’t on by default — if voiceManaging is unset on your AgentforceConfiguration, users don’t get SDK-managed voice dictation into the chat compose field.
This default was removed because it caused recurring onboarding issues for external customers, and because the platform’s native keyboard mic is more stable and easier to integrate than a bundled SDK speech-to-text implementation.
AgentforceVoiceManaging covers only chat-input speech-to-text dictation — it’s independent of the real-time Agent Voice (LiveKit) conversation feature described earlier in this guide, which is wired separately. Omitting voiceManaging has no effect on Agent Voice conversations; it only means the chat-input mic button is hidden.
If you don’t need custom speech-to-text behavior, no action is needed. Users can dictate into the chat input field using the platform’s native keyboard mic (dictation), which works out of the box without any SDK configuration.
If you want SDK-managed speech-to-text, implement the AgentforceVoiceManaging interface yourself and pass it to setVoiceManaging on AgentforceConfiguration.Builder.
A conforming type must supply:
requestVoiceInput(updateResults: (result: String?) -> Unit, endSpeech: () -> Unit)— called when voice input is invoked; report results throughupdateResultsand callendSpeechwhen input is complete.stopVoiceInput()— stops voice translation manually.isVoiceSupported(context: Context): Boolean— reports whether the device supports voice translation.checkVoiceApproval(enabledCallback: () -> Unit, context: Context, warningTitle: String, warningMessage: String)— checks or requests device voice/audio permission, showing a warning dialog with the given title and message if needed, then callsenabledCallbackonce approved.checkOnDeviceModelAvailable(onResult: (available: Boolean) -> Unit)— asynchronously reports, on the main thread, whether an on-device speech recognition model is installed for the user’s current locale.
These five members are the complete AgentforceVoiceManaging contract — there are no other required members.
See AgentforceConfiguration in the AFMSDK API reference for the voiceManaging property and setVoiceManaging builder function.