This site is no longer updated.Go to new Conversational Cloud docs

audio


Description

audio — use this tag to include audio recordings to bot replies.

Value type

  • string

Parameters

  • name (string) — audio file name, an optional parameter.

Nested data

  • none

Syntax

A link to an audio.

state: Hello
    q!: hi
    audio: https://example.com/audio.wav

You can also specify the name of the file.

state: Hello
    q!: hi
    audio: https://example.com/audio.wav || name = welcome.wav

Each channel has its own restrictions on audio files that can be uploaded, for example, on the playback duration or size. Make sure your file complies with all the channel requirements.

How to use

Here is an example:

state: Hello
    q!: hi
    random:
        audio: https://example.com/audio1.wav
        audio: https://example.com/audio2.wav

We use two audio files here. random execution results in only one of the nested reactions being executed, i.e. one of the two files will be replayed.

You can use the <responseData> tag for testing. For example:

<test-case id="test 2">
  <q>test 2</q>
  <responseData>
    {
      "replies": [
        {
          "type": "audio",
          "audioUrl": "https://example.com/audio.wav",
          "audioName": "welcome.wav",
          "state": "/2"
        }
      ]
    }
  </responseData>
</test-case>

Learn more about script tests