Set up the Template for Audio Choice from a List

Audio choice from a list allows the end user to select between a set number of audio files in a drop-down field.

To configure the template, you will need to edit the .html file (see Update the HTML File) and .json file (see Update the params.json File).

HTML File

The HTML file must have a div class that will contain the choice of audio files offered to the end user:

Copy
<div class="imageContainer">
    <img data-publish-id="Music" class="audio" src="./audio/music1.mp3" alt="main audio" />
</div>

JSON File

The params.json file must have a corresponding section that contains the choice of audio files offered to the end user:

Copy
{
    "id": "Music",
    "label": "audio",
    "default": "./audio/music1.mp3",
    "type": "audio",
    "choices": [
        { "label": "Music 1", "value": "./audio/music1.mp3" },
        { "label": "Music 2", "value": "./audio/music2.mp3" },
        { "label": "Music 3", "value": "./audio/music3.mp3" },
        { "label": "Music 4", "value": "./audio/music4.mp3" }
    ]
}