Skip to content
Docs menu

Step 1: your first sound

Step 1 of 8

One call that describes a sound and gets a file.

The whole product rests on one call: describe a sound, get a file. Make it work on its own first.

# soundscape.py
from falcore import Catalyst

catalyst = Catalyst()                                    # reads FALCORE_API_KEY
sound = catalyst.wave.generate("rain on a tin roof", duration=4)
print(sound.file.file_id, sound.usage.plumes, "plumes")
path = catalyst.download(sound, "rain.mp3")
print("saved", path)

Running it prints two lines:

fil_005033c8d6174369a80df306 0 plumes
saved rain.mp3
Note

The file id and PLUMES number differ for you (the id is new every call, and the number is your administrator's price). saved rain.mp3 is the path you passed to download.

Run it: python soundscape.py, npx tsx soundscape.ts or cargo run. You get a rain.mp3 file.

What just happened

  1. Catalyst read your key and built a client. It also created a private session for you (see step 4).
  2. wave.generate sent your description to the Wave model and waited for the answer. The answer is a Generation: it holds the files and what the call cost.
  3. download asked the API for a signed link to the file and saved it. The format defaults to mp3.

Checkpoint (M1): a playable rain.mp3, and the program printed its file id and cost.