Playing background audio during a call

The bot can dynamically play background audio during a call.

For example, soft ambient music can be played in the background while the bot speaks, to enhance user experience.

Playing from a Remote Audio File via URL

Background audio can be streamed from a remote server by specifying the audio file URL and related parameters such as format, volume, and caching.

The audio file format must be a supported format listed below.

This feature is supported only by VoiceAI Connect Enterprise (and from version 3.24.3 and later).

How do I use it?

To enable this feature, the VoiceAI Connect Administrator should configure the following parameter:

Parameter

Type

Description

backgroundPlayEnable

 

Boolean

Enables background music playback.

  • true

  • false (Default)

This feature is configured by the bot using the following parameters:

Parameter

Type

Description

 backgroundPlayURL

String

Defines the URL of the audio file to be played.

To stop playback, set backgroundPlayURL to null.

 backgroundPlayMediaFormat

String

Defines the format of the audio file:

  • raw/lpcm16

  • wav/lpcm16 (default)

  • raw/lpcm16_8

  • wav/lpcm16_8

  • raw/lpcm16_24

  • wav/lpcm16_24

  • raw/μ-mulaw

  • wav/ μ-mulaw

 backgroundPlayUrlCaching

Boolean

Enables or disables caching of the audio file.

  • true

  • false (Default)

 backgroundPlayVolume

Integer

Defines the playback volume.

Range: -32 to 32 dB

Default: 0 dB

Example

The following example enables background music with a volume of -5 dB:

{
  "type": "event",
  "name": "config",
  "sessionParams": {
    "backgroundPlayURL": "https://example.com/audio-ulaw.wav",
    "backgroundPlayMediaFormat": "wav/ulaw",
    "backgroundPlayGainDb": -5
 }

Playing from Pre-recorded Tone File (PRT)

Background audio can be played using a pre-recorded tone stored on the AudioCodes SBC, configured via the backgroundTone parameter

With this method, the bot cannot dynamically change the background audio during a call.

This feature is supported only by VoiceAI Connect Enterprise (and from Version 3.10 and later).

How do I use it?

This feature is configured by the VoiceAI Connect Administrator only, using the following bot configuration parameter:

Parameter

Type

Description

 backgroundTone

String

Defines which recorded audio (user defined tone type) to play from the PRT file.

The syntax is shown below:

"backgroundTone": "1"

(e.g., "backgroundTone": "1"is the toned defined for UserDefined_1).