CambAI icon

CambAI

Interact with CambAI API for text-to-speech and voice generation

Actions4

Overview

The node "CambAI" integrates with the CambAI API to generate audio content from text prompts. Specifically, for the Sound resource and Generate Sound operation, it converts a textual description of a sound into an audio file that can be played back or downloaded. This is useful in scenarios such as creating ambient sound effects (e.g., ocean waves, rain), generating custom soundscapes for multimedia projects, or producing audio cues for applications.

Practical examples:

  • Generating a 10-second clip of forest sounds for a meditation app.
  • Creating background noise like city traffic for video production.
  • Producing unique sound effects described by users dynamically.

Properties

Name Meaning
Prompt The textual description of the sound to generate (e.g., "ocean waves crashing").
Duration Length in seconds for how long the generated sound should play.
Additional Options A collection of optional settings:
- Output Type How the final audio is retrieved: either as raw audio bytes in FLAC format or a downloadable URL.
- Polling Interval Time in seconds between status checks when waiting for the sound generation to complete.
- Polling Timeout Maximum time in seconds to wait for the text-to-sound process before timing out.

Output

The node outputs JSON data containing the generated sound information. Depending on the selected output type:

  • If Raw Bytes (FLAC) is chosen, the output includes the direct audio file stream encoded in FLAC format, suitable for immediate playback or further processing.
  • If File URL is selected, the output provides a downloadable URL pointing to the generated audio file.

This allows flexible usage depending on whether the user wants to handle the audio data directly or access it via a link.

Dependencies

  • Requires an active CambAI API key credential configured in n8n to authenticate requests.
  • Network access to https://client.camb.ai/apis endpoint.
  • Proper configuration of polling intervals and timeout to manage asynchronous sound generation.

Troubleshooting

  • Common issues:

    • Timeout errors if the sound generation takes longer than the specified polling timeout.
    • Invalid prompt descriptions may result in failed or empty audio outputs.
    • Network or authentication failures due to missing or incorrect API credentials.
  • Error messages and resolutions:

    • "Authentication failed": Verify that the API key credential is correctly set up and valid.
    • "Timeout waiting for sound generation": Increase the polling timeout or check the network connection.
    • "Invalid input parameters": Ensure the prompt is non-empty and duration is a positive number.

Links and References

  • CambAI official API documentation (refer to CambAI website for detailed API specs)
  • n8n documentation on creating and using API credentials
  • Audio formats overview: FLAC

Discussion