npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cleanvoice/cleanvoice-sdk

v3.0.2

Published

Official TypeScript SDK for Cleanvoice AI audio processing

Downloads

2,424

Readme

Cleanvoice SDK

Official TypeScript SDK for Cleanvoice AI. Upload local files or use remote URLs, process audio or video, and download cleaned results from Node.js.

npm version License: MIT

Table of Contents

Installation

npm install @cleanvoice/cleanvoice-sdk

Quick Start

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

const result = await client.process(
  'https://example.com/podcast.mp3',
  {
    fillers: true,
    normalize: true,
    studio_sound: true,
    summarize: true,
  },
  {
    outputPath: 'podcast-clean.mp3',
  }
);

console.log(result.media.url);
console.log(result.audio.localPath);
console.log(result.transcript?.summary);

Authentication

Get your API key from the Cleanvoice Dashboard.

Recommended:

export CLEANVOICE_API_KEY="your-api-key-here"
import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

Explicit constructor:

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = new Cleanvoice({
  apiKey: 'your-api-key-here',
  baseUrl: 'https://api.cleanvoice.ai/v2',
  timeout: 60000,
});

Common Patterns

Choose the pattern that fits your workflow:

| Pattern | When to use | | --- | --- | | process() | One-call processing for scripts, jobs, and backend routes | | createEdit() + getEdit() | Submit now, poll later | | process(..., { outputPath }) | Process and save in one call | | processAndDownload() | Get both the result object and local saved path |

Notes:

  • Local file upload is supported for Node.js and other server-side runtimes.
  • Browser clients should keep API keys server-side and use backend routes.
  • social_content: true automatically enables summarize.
  • summarize: true automatically enables transcription.

Examples

Basic Audio Cleaning

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

const result = await client.process('https://example.com/podcast.mp3', {
  fillers: true,
  long_silences: true,
  normalize: true,
  remove_noise: true,
});

console.log(result.audio.url);
console.log(result.audio.statistics.FILLER_SOUND);

Local File Upload

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

const result = await client.process(
  '/absolute/path/to/recording.mp3',
  {
    normalize: true,
    studio_sound: true,
  },
  {
    outputPath: 'recording-clean.mp3',
  }
);

console.log(result.audio.localPath);

Progress Updates

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

const result = await client.process(
  'https://example.com/audio.mp3',
  { summarize: true },
  {
    polling: {
      onProgress: ({ status, progress, attempt }) => {
        console.log(`Attempt ${attempt}: ${status}`, progress?.done ?? 0);
      },
    },
  }
);

console.log(result.transcript?.summary);

Submit First, Poll Later

import { Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

const editId = await client.createEdit('https://example.com/audio.mp3', {
  fillers: true,
  normalize: true,
});

const edit = await client.getEdit(editId);
console.log(edit.status);

More Examples

File Upload and Download

Upload Only

const url = await client.uploadFile('/absolute/path/to/audio.mp3');
console.log(url);

Download Only

const localPath = await client.downloadFile(
  'https://cdn.cleanvoice.ai/output/audio.mp3',
  'audio.mp3'
);

Download from a Result

const result = await client.process('https://example.com/audio.mp3', {
  normalize: true,
});

const savedPath = await result.audio.download('enhanced.mp3');
console.log(savedPath);

One-Call Process and Download

const [result, savedPath] = await client.processAndDownload(
  'https://example.com/audio.mp3',
  'enhanced.mp3',
  {
    fillers: true,
    normalize: true,
  }
);

console.log(savedPath);
console.log(result.audio.localPath);

API Reference

Cleanvoice.fromEnv(options?)

Creates a client from environment variables.

Default variables:

  • CLEANVOICE_API_KEY
  • CLEANVOICE_BASE_URL
  • CLEANVOICE_TIMEOUT

process(fileInput, config?, options?)

Processes a remote URL or local file path and waits for completion.

options supports:

  • outputPath
  • download
  • templateId
  • uploadType
  • polling

createEdit(fileInput, config?, options?)

Creates an edit job and returns an edit ID without waiting for completion.

getEdit(editId)

Fetches the latest edit status and result payload.

uploadFile(filePath, filename?)

Uploads a local file and returns the public uploaded URL.

downloadFile(url, outputPath?)

Downloads a remote file to disk.

processAndDownload(fileInput, outputPath?, config?, options?)

Processes a file and returns both the ProcessResult and the saved output path.

checkAuth()

Verifies the API key and returns the current credit balances.

const account = await client.checkAuth();

console.log(account.credit.total);
console.log(account.credit.subscription);
console.log(account.credit.payg);

The JavaScript SDK returns the public credit balances only.

Configuration Options

Core Processing

| Option | Type | Description | | --- | --- | --- | | fillers | boolean | Remove filler sounds | | stutters | boolean | Remove stutters | | long_silences | boolean | Remove long silences | | mouth_sounds | boolean | Remove mouth sounds | | hesitations | boolean | Remove hesitations | | muted | boolean | Mute edits instead of cutting | | remove_noise | boolean | Remove background noise | | keep_music | boolean | Preserve music sections | | breath | boolean \| string | Breath reduction mode | | normalize | boolean | Normalize loudness | | autoeq | boolean | Legacy automatic EQ | | studio_sound | boolean \| string | Studio sound mode | | sound_studio | boolean \| string | Legacy alias for studio_sound |

Output and Routing

| Option | Type | Description | | --- | --- | --- | | export_format | 'auto' \| 'mp3' \| 'wav' \| 'flac' \| 'm4a' | Output format | | mute_lufs | number | Mute threshold in LUFS | | target_lufs | number | Target loudness in LUFS | | export_timestamps | boolean | Export timestamp markers | | signed_url | string | Upload results to your own signed URL | | send_email | boolean | Email the result to the account |

AI Features

| Option | Type | Description | | --- | --- | --- | | transcription | boolean | Generate transcription | | summarize | boolean | Generate summarization | | social_content | boolean | Generate social-ready content |

Media and Advanced

| Option | Type | Description | | --- | --- | --- | | video | boolean | Force video mode | | merge | boolean | Merge multi-track audio | | audio_for_edl | boolean | Backend-specific audio-for-EDL flag | | automix | boolean | Backend automix flag | | trim | boolean | Backend trim flag | | waveform_preview | boolean | Request waveform preview data |

Error Handling

import { ApiError, Cleanvoice } from '@cleanvoice/cleanvoice-sdk';

const client = Cleanvoice.fromEnv();

try {
  const result = await client.process('https://example.com/audio.mp3', {
    fillers: true,
    normalize: true,
  });
  console.log(result.audio.url);
} catch (error) {
  if (error instanceof ApiError) {
    console.error(error.message);
    console.error(error.status);
    console.error(error.code);
  } else {
    console.error(error);
  }
}

The client retries brief transient transport and HTTP failures during requests and polling.

Supported Formats

Remote media URLs:

  • http://
  • https://

Local uploads (audio):

  • .wav
  • .mp3
  • .flac
  • .m4a

Video:

  • .mp4
  • .mov
  • .webm
  • .avi
  • .mkv

Development

npm run build
npm test
npm run test:coverage
npm run lint

Requirements

  • Node.js 16+
  • TypeScript 5+

Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes with tests.
  4. Submit a pull request.

Support

| | | | --- | --- | | Documentation | docs.cleanvoice.ai | | Email | [email protected] | | Issues | GitHub Issues |

License

MIT - see LICENSE.