CleanvoiceDocs
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 http:// or https:// 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

TypeFormats
Audio (local uploads).wav, .mp3, .flac, .m4a
Video.mp4, .mov, .webm, .avi, .mkv

For local uploads, use the formats above. Other audio containers may be rejected by the upload endpoint even if they are valid media files elsewhere in your pipeline.