TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/elevenlabs/llms.txt
Use this file to discover all available pages before exploring further.
SoundEffects resource generates short audio clips from natural-language descriptions in a single call. Describe any real-world or imagined sound — an environment, an action, a texture — and the API returns a ready-to-use audio file. The resource is intentionally minimal: one method, one return type, no multi-step flow required.
generate()
Produce a sound-effect audio clip from a descriptive text prompt.Internally, the
prompt argument is sent to the ElevenLabs
/sound-generation endpoint as the text field in the JSON request body.
The output_format option is extracted and forwarded as a URL query
parameter before the remaining options are serialised into the body.Parameters
A natural-language description of the sound to generate. Mapped to the
text key in the JSON request body. The more specific and vivid the
description, the more accurate and consistent the output tends to be.Optional generation controls.
Audio encoding for the returned file (e.g.
mp3_44100_128,
mp3_44100_64, pcm_44100). Defaults to mp3_44100_128. This value is
extracted from the options array and forwarded as a URL query parameter
before the remaining options are sent in the JSON body.Optional hint for the desired length of the sound effect in seconds.
When omitted, ElevenLabs infers a suitable duration from the prompt.
Return value
The generated audio. Call
->save($path) to write it to disk, or access
->data for the raw bytes and ->mimeType for the content type.Prompt examples
The quality of the output is directly tied to the quality of the prompt. Short, vague prompts can work, but clear, specific descriptions consistently produce more usable results.Saving and using the result
generate() returns an AudioResult. The output property is an AudioData object with two access patterns:
