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

voicemix

v1.2.6

Published

🗣️ VoiceMix - A simple text-to-speech tool using ElevenLabs, Cartesia and Resemble AI APIs.

Readme

VoiceMix

VoiceMix is a flexible text-to-speech library that allows you to generate speech from text using different voices, languages, and customization options.

Installation

npm install voicemix dotenv

Environment Setup

Create a .env file in your project root with your API keys:

ELEVENLABS_API_KEY="6e04xxxxxxxxxxxxxxxxxxxxxxxxa9da"
RESEMBLE_API_KEY="9YWxxxxxxxxxxxxxxxxxmgtt"
CARTESIA_API_KEY="sk_car_xxxxxxxxxxxxxxxxxxxxjr"

Usage

Basic Example

import { VoiceMix } from 'voicemix';
import dotenv from 'dotenv';
dotenv.config();

const voiceMix = new VoiceMix();

voiceMix
    .voice('EbhcCfMvNsbvjN6OhjpJ')
    .say('Hello, world!')
    .save();

Using ElevenLabs v3 Model

const voiceMix = new VoiceMix();

voiceMix
    .v3() // Use the latest ElevenLabs v3 model
    .voice('EbhcCfMvNsbvjN6OhjpJ')
    .say('Hello! This is using the ElevenLabs v3 model.')
    .save();

The v3 model is the latest and most advanced model from ElevenLabs, providing the most natural and expressive voice generation.

Advanced Usage

Using Resemble AI

const voiceMix = new VoiceMix();

voiceMix
    .useResemble()  // https://www.resemble.ai/
    .prompt('Friendly and conversational tone') // Set voice prompt/style
    .voice('ba875a0a') // Select specific voice
    .lang('en-US') // Set language
    .say('Your text here')
    .save();

Using Cartesia

const voiceMix = new VoiceMix();

voiceMix
    .useCartesia()  // https://cartesia.ai/
    .voice('your-cartesia-voice-id') // Select specific voice from your Cartesia account
    .say('Your text here')
    .save();

Note: You need to use a valid voice ID from your Cartesia account. You can find available voices in your Cartesia dashboard.

Batch Processing

You can process multiple lines of text using a JSON configuration:

import { VoiceMix } from 'voicemix';
import fs from 'fs';

// Read script from JSON file
const script = JSON.parse(fs.readFileSync('./lines.json', 'utf8'));
const voiceMix = new VoiceMix();

// Process each line
for (const entry of script) {
    voiceMix
        .prompt(entry.prompt || 'Friendly and conversational tone')
        .voice(entry.voiceId)
        .say(entry.english)
        .save();
}

Example lines.json:

[
    {
        "prompt": "Friendly and conversational tone",
        "english": "Hello, how are you today?",
        "voiceId": "EbhcCfMvNsbvjN6OhjpJ"
    }
]

Features

  • Multiple voice support
  • Language selection
  • Voice prompts for style control (Resemble AI)
  • Support for multiple TTS providers:
    • ElevenLabs (including v3 model)
    • Resemble AI
    • Cartesia
  • Support for different ElevenLabs models:
    • monolingual_v1() - Original English model
    • multilingual_v1() - First multilingual model
    • multilingual_v2() - Improved multilingual model (default)
    • v3() - Latest and most advanced model
  • Simple chainable API

License

MIT