Skip to main content

SFX Endpoint

Overview​

The SFX endpoint allows you to generate sound effects (SFX) from text prompts. It takes user input in the form of a text prompt to conditionally generate audio effects.

Sample Generation​


Example 1​

Prompt:​

The sound of a bustling city street with footsteps, faint conversations, and vehicle sounds.

Generated Music:​


Example 2​

Prompt:​

Typing on a mechanical keyboard in a small office.

Generated Music:​


Request​

--request POST 'https://modelslab.com/api/v1/enterprise/voice/sfx' \

Make a POST request to https://modelslab.com/api/v1/enterprise/voice/sfx endpoint and pass the required parameters as a request body.

caution

Make sure you add your s3 details for voice_cloning server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after 24 hours

Body Attributes​

ParameterDescriptionValues
keyYour API Key used for request authorizationstring
promptA descriptive prompt that conditions the audio generation, specifying the type of sound effect desired.string

Example​

Body​

Body
{
"key":"",
"prompt":"Thunderstorm with rain",
"temp": false,
"webhook": null,
"track_id": null
}

Request​

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"prompt":"Thunderstorm with rain",
"temp": false,
"webhook": null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v1/enterprise/voice/sfx", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response​

{
{
"eta": 5,
"fileId": "8b8f9044-bb13-4d2c-bc42-db427caf182d.wav",
"links": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/8b8f9044-bb13-4d2c-bc42-db427caf182d.wav"
],
"message": "Request has been queued",
"meta": {
"filename": "8b8f9044-bb13-4d2c-bc42-db427caf182d.wav",
"prompt": "man laughing",
"temp": "no"
},
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/8b8f9044-bb13-4d2c-bc42-db427caf182d.wav"
],
"seconds": null,
"status": "queued",
"taskId": "a3525188-a894-47ea-9946-1e5a8f2c4abb"
}
}