# soundtrack

## Getting the multi-regional soundtrack

## Generates and bounces a soundtrack

<mark style="color:green;">`POST`</mark> `/soundtrack`

#### Request Body

| Name                                      | Type   | Description                                                                                                      |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| regions<mark style="color:red;">\*</mark> | JSON   | An Array of [regions](#region-object-definition).                                                                |
| normalize                                 | String | Enables soundtrack [loudness normalization](#normalizing-soundtrack). Accept values: `none`, `auto` and `high`.  |

{% tabs %}
{% tab title="200: OK File successfully generated" %}
```json
// Sample response

{
    "apiVersion":"1.2.0",
    "mp3": "https://api.muzaic.ai/result/2024-01-31/st_3b12463ea3ecc474e22ebc302e70a0b3.mp3",
    "regions":[{"number":0,"hash":"6cc0b6861d5d369ec475d7236e9bfb63"},{"number":1,"hash":"9191593eb3992ba7c4307455c0e1b5ca"}],
    "status": "region 0 normalize: none | region 1 no params object | soundtrack normalized: auto",
    "tokensUsed": 65,
    "executionTime": 5.111389875412
}
```
{% endtab %}

{% tab title="400: Bad Request Bad request" %}
```
//example response

{
    "Error": "No regions list"
}
```
{% endtab %}
{% endtabs %}



### Region object definition

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>time</td><td>float</td><td>A position (start) of given region in seconds.</td><td>true</td></tr><tr><td>duration</td><td>float</td><td>Requested composition time in seconds. If no parameter value is passed, the default time value is 60 seconds. Currently, there is a limit set at 1200 seconds.</td><td>true</td></tr><tr><td>tags</td><td>Array (int)</td><td>An array of integers representing tag id's. </td><td>false</td></tr><tr><td>params</td><td>JSON</td><td>An object containing user music params values: <code>intensity</code>, <code>tempo,</code> <code>rhythm</code>, <code>tone</code> , <code>variance</code>. These values are either integers ranging from 1 to 9 (mean parameter value) or <a href="../../getting-the-music/quickly-getting-an-audio-file#understanding-keyframes-arrays">keyframes arrays</a> (except <code>tempo</code>).</td><td>false</td></tr><tr><td>sourceHash</td><td>String</td><td>A unique system music identifier obtained in a response. Please provide the <code>sourceHash</code> when you want to refer to a previously composed music region in your next call.</td><td>false</td></tr><tr><td>action</td><td>String</td><td>One of the possible <a href="../../getting-the-music/advanced-soundtracking#using-the-action-field">actions</a> for region generation process: 'generate', 'copy', 'regenerate' or 'extend'.</td><td>false</td></tr><tr><td>method</td><td>String</td><td>One of the <a href="../../getting-the-music/advanced-soundtracking#using-the-method-field">methods</a> to interpret <code>time</code> and <code>duration</code> fields is: 'strict', 'auto_adjust', 'adjust_start', or 'adjust_end'.</td><td>false</td></tr></tbody></table>

