---
sourceDocument: Referência de API do Brasil
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/api-reference

 Release :

    - brazil

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Brasil

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Classe do Now VoiceService - Android

# Classe do Now VoiceService - Android {#ariaid-title1}

Versão de lançamento: Brazil  
Atualizado 10 de set. de 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 min. de leitura  
Gerencia sessões do agente de voz para uma única ServiceNow instância.  
Nota:  
Inicialize um Now VoiceService chamando [NowVoiceSDK - makeVoiceService(instanceURL: URL)](https://servicenow-prod.fluidtopics.net/cFD8MrNkXIYyVt_gVFp4yA#NVoiceSDK-makeVoiceService_S "Cria uma instância do Now VoiceService para a ServiceNow instância especificada. Esta é uma função de suspensão.").  
{#NowVoiceServiceAndroidAPI__table_vx2_klw_nva1__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| configuração | [NowServiceConfiguration](https://servicenow-prod.fluidtopics.net/HGvosWrMRuLoGrGo~vPptQ "A classe NowServiceConfiguration permite configurar a ServiceNow URL da instância e o nome do pacote para um serviço de recurso.") | A configuração de serviço da ServiceNow instância. |
| IsMutado | Booliano | Sinalizador que indica o estado mudo do microfone para a chamada atual. A definição desta propriedade não terá efeito se nenhuma chamada estiver ativa no momento. Valores válidos: * Verdadeiro: O microfone está mudo. * Falso: O microfone não está mudo ou nenhuma chamada está ativa. {#NowVoiceServiceAndroidAPI__ul_png_bdk_jkc} |
| Now VoiceEndpoints | List\<NowVoiceEndpoint\>[Classe NowVoiceEndpoint - Android](https://servicenow-prod.fluidtopics.net/8hvvbu_Aq6CZ9yFsLC1y0g "Descreve um endpoint do agente de voz.") | Somente leitura. A lista de configurações de endpoint de voz disponíveis recuperadas da instância. |
[Tabela 1. Propriedades]

{#NowVoiceServiceAndroidAPI__table_vx2_klw_nva1}

## NowVoiceService - EndCall() {#ariaid-title2}

Termina a chamada de voz atual.
Não tem efeito se nenhuma chamada estiver ativa.
{#NVoiceServA-endCall__table_cs5_2ck_jkc__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 2. Parâmetros]

{#NVoiceServA-endCall__table_cs5_2ck_jkc} {#NVoiceServA-endCall__table_qft_qzv_nva8__entry__2}

| Tipo | Descrição |
|-|-|
| Nenhum(a) |   |
[Tabela 3. Retorna]

{#NVoiceServA-endCall__table_qft_qzv_nva8}  
O exemplo de código a seguir encerra a chamada de voz ativa.

    val voiceService = NowVoiceSDK.makeVoiceService(instanceUrl).getOrNull()

    val endpoint = voiceService?.nowVoiceEndpoints?.first()
    voiceService?.start(activity, endpoint = endpoint, theme = theme)

    // End a call on timeout, navigation, or from a custom hang-up button
    voiceService?.endCall()

## NowVoiceService - hasActiveCall() {#ariaid-title3}

Verifica se há uma chamada de voz ativa no momento.
{#NVoiceServA-hasActiveCall__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 4. Parâmetros]

{#NVoiceServA-hasActiveCall__table_qft_qzv_nva8__entry__2}

| Tipo | Descrição |
|-|-|
| Booliano | Sinalizador que indica se há uma chamada de voz ativa. Valores válidos: * Verdadeiro: Há uma chamada de voz ativa. * Falso: Não há uma chamada de voz ativa. {#NVoiceServA-hasActiveCall__ul_qs4_pbk_jkc} |
[Tabela 5. Retorna]

{#NVoiceServA-hasActiveCall__table_qft_qzv_nva8}  
O exemplo de código a seguir verifica se uma chamada de voz está em andamento.

    val voiceService = NowVoiceSDK.makeVoiceService(instanceUrl).getOrNull()

    val endpoint = voiceService?.nowVoiceEndpoints?.first()
    voiceService?.start(activity, endpoint = endpoint, theme = theme)

    // Guard UI state or prevent starting a second call
    if (voiceService?.hasActiveCall() == true) {
        // A voice call is currently in progress
    }

## NowVoiceService - start(context: Context, endpoint: NowVoiceEndpoint, uiConfiguration: NowVoiceUiConfiguration, retornos de chamada: NowVoiceCallbacks?, tema: NowVoiceTheme) {#ariaid-title4}

Inicia a atividade do agente de voz em tela cheia. Esta é uma função de suspensão que retorna após o término da sessão.
{#NVoiceServA-start_O_O_O_O_O__table_pft_qzv_nva2__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| contexto | [Contexto](https://developer.android.com/reference/kotlin/android/content/Context.html) | Um `contexto do Android` usado para iniciar a atividade de voz. Normalmente, sua `atividade atual`. |
| endpoint | [NowVoiceEndpoint](https://servicenow-prod.fluidtopics.net/8hvvbu_Aq6CZ9yFsLC1y0g "Descreve um endpoint do agente de voz.") | O endpoint do agente de voz ao qual se conectar. Obtenha em `NowVoiceService.nowVoiceEndpoints`. |
| UIConfiguration | [NowVoiceUIConfiguration](https://servicenow-prod.fluidtopics.net/ZqTE15UYfQbHsNs4WCCIrw#NVoiceUiConfigAndroidClass "Especifica opções de apresentação para a IU do agente de voz.") | Opcional. Opções de apresentação para a IU do agente de voz. Se omitido, usa os valores padrão para Configuração do NowVoiceUiConfiguration. |
| retornos de chamada | [NowVoiceCallbacks](https://servicenow-prod.fluidtopics.net/olOoN3geipw_A7QUpAchUQ "Fornece funções de retorno de chamada para o ciclo de vida da sessão de voz e eventos de conteúdo.")? | Opcional. Retornos de chamada para eventos de sessão de voz. Se `nulo`, os eventos serão ignorados silenciosamente. |
| tema | [NowVoiceTema](https://servicenow-prod.fluidtopics.net/0RWN3PuM90RjR2GmXM9egg "Personaliza a aparência visual da IU do agente de voz.") | Opcional. O tema visual aplicado à IU de voz. Padrão: O tema claro pré-criado. |
[Tabela 6. Parâmetros]

{#NVoiceServA-start_O_O_O_O_O__table_pft_qzv_nva2} {#NVoiceServA-start_O_O_O_O_O__table_qft_qzv_nva2__entry__2}

| Tipo | Descrição |
|-|-|
| Nenhum(a) |   |
[Tabela 7. Retorna]

{#NVoiceServA-start_O_O_O_O_O__table_qft_qzv_nva2}  
O exemplo de código a seguir mostra como chamar esta função.

    //voiceService is an initialized NowVoiceService
    val endpoint = voiceService.nowVoiceEndpoints.firstOrNull() ?: return

    voiceService.start(
        context = this@MainActivity,
        endpoint = endpoint,
        uiConfiguration = NowVoiceUiConfiguration(
            hidePostCallTranscript = false,
            shouldBlockAttachmentSharing = false
        ),
        callbacks = object : NowVoiceCallbacks {
            override fun onCallEnd(conversationId: String?, error: NowVoiceError?) {
                if (error != null) {
                    Log.e("NowVoice", "Session ended with error: $error")
                } else {
                    Log.d("NowVoice", "Session complete. ID: $conversationId")
                }
            }

            override fun onMuteStateChanged(isMuted: Boolean) {
                // Update your UI to reflect the current mute state
                Log.d("NowVoice", "Microphone muted: $isMuted")
            }

            override fun onMessageReceived(message: TranscriptMessage) {
                // Receive real-time transcript messages
                Log.d("NowVoice", "${message.role}: ${message.content}")
            }
        },
        theme = object : NowVoiceTheme {}  // Uses default light theme
    )

## NowVoiceService - toggleMute() {#ariaid-title5}

Alterna o estado mudo do microfone da chamada atual.
{#NVoiceServA-toggleMute__table_cs5_2ck_jkc__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| Nenhum |   |   |
[Tabela 8. Parâmetros]

{#NVoiceServA-toggleMute__table_cs5_2ck_jkc} {#NVoiceServA-toggleMute__table_qft_qzv_nva7__entry__2}

| Tipo | Descrição |
|-|-|
| Booliano | Sinalizador que indica o novo estado mudo do microfone para a chamada atual. Valores válidos: * Verdadeiro: O microfone agora está mudo. * Falso: O microfone agora não está mudo ou nenhuma chamada está ativa. {#NVoiceServA-toggleMute__ul_png_bdk_jkc} |
[Tabela 9. Retorna]

{#NVoiceServA-toggleMute__table_qft_qzv_nva7}  
O exemplo de código a seguir alterna e lê o estado mudo do microfone.

    val voiceService = NowVoiceSDK.makeVoiceService(instanceUrl).getOrNull()

    val endpoint = voiceService?.nowVoiceEndpoints?.first()
    voiceService?.start(activity, endpoint = endpoint, theme = theme)

    // Wire to a custom mute button or auto-mute on backgrounding
    voiceService?.toggleMute()

    // Check mute state to update a custom mute button icon
    val muted = voiceService?.isMuted ?: false

## NowVoiceService - updateTheme(theme: NowVoiceTheme) {#ariaid-title6}

Atualiza o tema visual da IU de voz ativa no momento.
Esta função não terá efeito se nenhuma sessão de voz estiver ativa no momento. Para aplicar um tema visual na inicialização da sessão de voz, forneça um tema ao chamar [start(context:endpoint:uiConfiguration:callbacks:theme:)](https://servicenow-prod.fluidtopics.net/qC97Tx~AobzLV2p0x_T2sw#NVoiceServA-start_O_O_O_O_O "Inicia a atividade do agente de voz em tela cheia. Esta é uma função de suspensão que retorna após o término da sessão.").
{#NVoiceServA-updateTheme_O__table_pft_qzv_nva3__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| tema | [NowVoiceTema](https://servicenow-prod.fluidtopics.net/0RWN3PuM90RjR2GmXM9egg "Personaliza a aparência visual da IU do agente de voz.") | O tema a ser aplicado à IU de voz ativa. |
[Tabela 10. Parâmetros]

{#NVoiceServA-updateTheme_O__table_pft_qzv_nva3} {#NVoiceServA-updateTheme_O__table_qft_qzv_nva3__entry__2}

| Tipo | Descrição |
|-|-|
| Nenhum(a) |   |
[Tabela 11. Retorna]

{#NVoiceServA-updateTheme_O__table_qft_qzv_nva3}  
O exemplo de código a seguir atualiza o tema visual da IU de voz ativa no momento.

    val voiceService = NowVoiceSDK.makeVoiceService(instanceUrl).getOrNull()

    val endpoint = voiceService?.nowVoiceEndpoints?.first()
    voiceService?.start(activity, endpoint = endpoint, theme = theme)

    // React to dark mode changes or apply brand colors at runtime
    voiceService?.updateTheme(NowVoiceThemeDark())


