Updated on 2023-03-23 GMT+08:00

Disabling Prompt Tones

DisableVoicePrompts

API Description

This API is used to disable prompt tones.

Precautions

  1. This API is optional. If it is not called, prompt tones are played by default.
  2. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode DisableVoicePrompts(const HwmVoicePromptsInfo* voicePromptsInfo);

Callback Function

1
virtual void OnDisableVoicePromptsResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

voicePromptsInfo

Yes

HwmVoicePromptsInfo

Prompt tone information.

Table 2 HwmVoicePromptsInfo parameter

Parameter

Mandatory

Type

Description

isDisableMutePrompt

Yes

bool

Whether to disable the mute prompt tone.

Return Values

Table 3 Return value

Type

Description

HwmErrCode

If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/**
* Disable prompt tones.
*/
void demoDisableVoicePromptsDlg::DisableVoicePrompts()
{
    hwmsdkagent::HwmVoicePromptsInfo info{};
    info.isDisableMutePrompt = true;
 
    int ret = hwmsdkagent::DisableVoicePrompts(&info);;
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("disable voice prompts error"));
        return;
    }
    CDialogEx::OnOK();
}