GET
/
text-to-sound-result
/
{run_id}
curl --request GET \
  --url https://client.camb.ai/apis/text-to-sound-result/{run_id} \
  --header 'x-api-key: <api-key>'
This response does not have an example.

This endpoint retrieves the audio output generated from a previously completed Text to Sound task. It provides access to the audio content that was created based on the text prompt and configuration specified in your original request based on returned run_id.

The endpoint supports two different response formats based on your needs:

Audio Stream (Default)

Returns the raw audio bytes of your generated sound effect in WAV format. This is ideal for:

  • Direct playback in browser applications
  • Immediately saving the audio to your local system
  • Streaming the audio to users in real-time applications

Download URL

Content-Type: application/json

Returns a JSON object containing a URL where the generated audio file can be downloaded:

{
  "file_url": "https://storage.example.com/text-to-sound/your-generated-file.wav"
}

This option is useful when you prefer to:

  • Defer the actual download to a later time
  • Share the audio file with others via a link
  • Implement custom download behavior in your application

Example Usage

Retrieving Audio as a Stream

curl -X GET "https://api.example.com/text-to-sound-result/run_abc123" \
  -H "x-api-key: YOUR_API_KEY" \
  --output my_sound_effect.wav

Retrieving a Download URL

curl -X GET "https://api.example.com/text-to-sound-result/run_abc123" \
  -H "x-api-key: YOUR_API_KEY"

Response:

{
  "file_url": "https://storage.example.com/sounds/abc123.wav"
}

Best Practices

To get the most from this endpoint:

  1. Check Task Status First: Only request results for tasks that have completed successfully.
  2. Handle Audio Appropriately: The returned WAV format is widely compatible but may need conversion for specific use cases.
  3. Download Promptly: Temporary URLs may expire after a certain period, so download and store important files.

Technical Considerations

  • The generated audio files are delivered in WAV format which provides high quality but larger file sizes.
  • If the specified run_id doesn’t exist or hasn’t completed processing, you’ll receive an appropriate error response.

By integrating this endpoint with your audio production workflow, you can seamlessly access AI-generated sound effects created from text descriptions, enabling new creative possibilities for your projects.

Authorizations

x-api-key
string
header
required

The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.

Path Parameters

run_id
integer
required

The unique identifier for the run, which was generated during the text to an audio effect creation process and returned upon task completion.

Response

200
audio/wav

Successful Response

The generated audio file bytes in WAV format, representing the audio effect created from the provided text prompt.