CleanvoiceDocs
Python SDK

Uploads

How to provide audio or video files with the Python SDK.

The Python SDK accepts files in three ways as the first argument to client.process() or client.create_edit().

Option 1: Public URL

Pass a publicly accessible URL directly. The Cleanvoice API fetches the file from your URL — no upload step needed.

result = client.process(
    "https://example.com/episode.mp3",
    fillers=True,
    normalize=True,
)

Works with any direct download URL: S3, GCS, Dropbox (?dl=1), Google Drive, or your own CDN.

Option 2: Local file path

Pass a local file path as a string. The SDK uploads the file automatically before submitting the edit job.

result = client.process(
    "/path/to/episode.mp3",
    fillers=True,
    normalize=True,
)

The upload happens transparently — you get the same result object back regardless of whether you used a URL or a local path.

Option 3: NumPy array

Pass a tuple of (audio_array, sample_rate). Useful in Jupyter notebooks or audio processing pipelines where you already have audio loaded in memory.

import numpy as np
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,
)

# Get result as a NumPy array too
cleaned_audio, out_sample_rate = result.download_audio(as_numpy=True)

Upload separately

If you want to upload a file once and reuse the URL across multiple edit requests, use upload_file():

remote_url = client.upload_file(
    "/path/to/episode.mp3",
    remote_filename="episode.mp3",  # optional
)
print("Uploaded to:", remote_url)

# Use the URL in subsequent requests
result = client.process(remote_url, fillers=True, normalize=True)

Uploaded files are automatically deleted 7 days after processing.

Supported formats

TypeFormats
AudioWAV, MP3, OGG, FLAC, M4A, AIFF, AAC
VideoMP4, MOV, WebM, AVI, MKV