Uploads
How to provide audio or video files with the Python SDK.
client.process()
client.process() is the main entry point of the SDK. Pass it your audio or video source and any editing options — it handles upload (when needed), job submission, polling, and returns the result when processing is complete.
result = client.process(source, fillers=True, normalize=True)Arguments: source — your file input (see options below) · editing options as keyword args (see Configuration)
Returns: a result object with result.audio.url and result.download_audio()
Overview — which input to use
| Method | Best when |
|---|---|
| Public URL | File is already hosted at an http:// or https:// URL |
| Local file path | File is on disk — SDK handles the upload |
| NumPy array | You already have decoded samples in memory |
upload_file() | Upload once, run multiple edits on the same file |
Option 1: Public URL
What to pass: a public http:// or https:// URL
How it works: Cleanvoice fetches the file directly from your URL — no upload step on your end. The URL must be publicly accessible (no auth headers).
result = client.process(
"https://example.com/episode.mp3",
fillers=True,
normalize=True,
)Works with S3, GCS, Dropbox (?dl=1), Google Drive, or any CDN direct-download URL.
Option 2: Local file path
What to pass: a local file path as a string
How it works: The SDK detects a local path, uploads the file to Cleanvoice's storage automatically, then submits the edit job — all in one call. You get back the same result object as with a URL.
result = client.process(
"/path/to/episode.mp3",
fillers=True,
normalize=True,
)Option 3: NumPy array
What to pass: a (audio_array, sample_rate) tuple
How it works: The SDK encodes the array in memory and uploads it, skipping any temporary file. Useful in Jupyter notebooks, librosa pipelines, or anywhere audio is already decoded.
from cleanvoice import Cleanvoice
client = Cleanvoice.from_env()
audio_array, sample_rate = load_audio("episode.wav") # your loading logic
result = client.process(
(audio_array, sample_rate),
fillers=True,
normalize=True,
)
# Download result as a NumPy array
cleaned_audio, out_sample_rate = result.download_audio(as_numpy=True)Bonus: Upload separately with upload_file()
What to pass: a local file path to upload_file() — then use the returned URL in client.process()
How it works: Uploads the file once and gives you a hosted URL you can reuse across multiple process() calls (different configs, retries, A/B). Useful when you want to separate ingest from job submission.
remote_url = client.upload_file(
"/path/to/episode.mp3",
filename="episode.mp3", # optional
)
result = client.process(remote_url, fillers=True, normalize=True)Uploaded files are automatically deleted 7 days after processing.
Supported formats
| Type | Formats |
|---|---|
| Audio (local uploads) | WAV, MP3, FLAC, M4A |
| Video | MP4, MOV, WebM, AVI, MKV |
For local uploads, use the formats above. Remote URLs can still point to other media files that the Cleanvoice API can fetch directly.