POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/sound-generation"; const data = { "text": "Looking good", "duration_seconds": 1, "prompt_influence": 0.3 }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


textstr *

The text that will get converted into a sound effect.


duration_secondsint ( default: 1 ) Affects Pricing

The duration of the sound which will be generated in seconds. Must be at least 0.5 and at most 22. If set to None we will guess the optimal duration using the prompt. Defaults to None.

min : 0.5,

max : 22


prompt_influenceint ( default: 1 ) Affects Pricing

A higher prompt influence makes your generation follow the prompt more closely while also making generations less variable. Must be a value between 0 and 1. Defaults to 0.3.

min : 0,

max : 1

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Sound Generation

Eleven Labs' Sound Generation API provides a robust development tool for programmatically generating audio content using artificial intelligence. This API allows developers and creators to integrate sound generation functionalities into their applications and workflows.

Core Functionalities of the Eleven Labs Sound Generation

  • Text-to-Sound Conversion: Transform textual descriptions of sounds into corresponding audio files. Users can specify desired sound types, durations, and intensity for precise control.

  • Custom Audio Synthesis: Generate unique audio samples based on user-defined parameters, enabling the creation of novel and specific sound effects.

  • Multilingual Support: Generate sound effects from text descriptions in various languages, expanding the reach and creative potential of audio projects.

  • Seamless Integration: Integrate the API into existing development environments for efficient audio generation within applications and games.

Benefits of Utilizing the Eleven Labs Sound Generation API

  • Enhanced Content Creation: Streamline sound effect generation within game development, video production, and other creative processes.

  • Efficient Workflow Integration: Integrate audio creation directly into development workflows, eliminating the need for separate sound design tools.

  • Scalable Audio Production: Generate large volumes of sound effects on-demand, facilitating efficient content creation.

  • Custom Audio Exploration: Experiment with user-defined parameters to explore new and unique sound design possibilities.

  • Multilingual Content Development: Create sound effects for a global audience by leveraging multilingual text descriptions.