JavaScript SDK
Uploads
How to provide audio or video files with the JavaScript SDK.
The JavaScript SDK accepts files as the first argument to client.process() or client.createEdit().
Option 1: Public URL
Pass a publicly accessible URL directly. The Cleanvoice API fetches the file from your URL — no upload step needed.
import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';
const client = Cleanvoice.fromEnv();
const result = await 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.
const result = await 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: Upload manually
If you need the upload URL separately, use uploadFile():
const url = await client.uploadFile('/path/to/episode.mp3');
console.log('Uploaded to:', url);
const result = await client.process(url, { fillers: true });Supported formats
| Type | Formats |
|---|---|
| Audio | .wav, .mp3, .ogg, .flac, .m4a, .aiff, .aac, .opus |
| Video | .mp4, .mov, .webm, .avi, .mkv |