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

xtts-sdk

v1.1.1

Published

Advanced Text-to-Speech SDK with streaming capabilities

Readme

XTTS SDK

Advanced Text-to-Speech SDK with streaming capabilities and high-quality audio synthesis.

Features

  • 🎙️ High-quality text-to-speech synthesis
  • 🌊 Real-time audio streaming
  • 🎵 Multiple audio format support (MP3, WAV, PCM)
  • 🔊 Direct audio playback
  • ⚡ Async/await API
  • 🎛️ Customizable voice settings (speed, volume, pitch)
  • 📦 Lightweight and easy to use

Installation

npm install
npm run build

Quick Start

const { XTTS } = require('xtts-sdk');

async function main() {
  const tts = new XTTS();

  await tts.initialize();
  await tts.synthesizeToFile('Hello, world!', 'output.mp3');
  await tts.close();
}

main();

API Reference

Constructor

new XTTS(options)

Options:

  • voiceSettings: Voice configuration
    • speed: Speech speed (default: 1.0)
    • vol: Volume (default: 1.0)
    • pitch: Pitch adjustment (default: 0)
    • englishNormalization: Enable English text normalization
  • audioSettings: Audio format configuration
    • sampleRate: Sample rate in Hz (default: 32000)
    • bitrate: Bitrate (default: 128000)
    • format: Audio format - 'mp3', 'wav', or 'pcm' (default: 'mp3')
    • channel: Number of channels (default: 1)

Methods

initialize()

Connects to the TTS service and starts a synthesis task.

await tts.initialize();

synthesizeToFile(text, outputPath)

Synthesizes text and saves to a file.

await tts.synthesizeToFile('Hello!', 'output.mp3');

synthesizeToStream(text, onChunk)

Synthesizes text with streaming callback.

await tts.synthesizeToStream('Hello!', (chunk) => {
  console.log(`Received ${chunk.length} bytes`);
});

synthesizeAndPlay(text, format, sampleRate)

Synthesizes and plays audio (requires ffplay).

await tts.synthesizeAndPlay('Hello!');

close()

Closes the connection and cleans up resources.

await tts.close();

Events

  • connected: Fired when connected to the service
  • taskStarted: Fired when synthesis task starts
  • audioChunk: Fired for each audio chunk received
  • complete: Fired when synthesis is complete
  • error: Fired on errors
  • disconnected: Fired when disconnected
tts.on('audioChunk', (chunk) => {
  console.log('Received chunk:', chunk.length);
});

Examples

See the examples/ directory for complete examples:

  • basic-usage.js: Simple synthesis examples
  • advanced-usage.js: Custom settings and event handling

Requirements

  • Node.js 14+
  • FFplay (optional, for audio playback)

Building

# Install dependencies
npm install

# Build TypeScript and apply heavy obfuscation
npm run build

# Verify protection (checks for exposed secrets)
npm run verify

# Clean build
npm run clean

Security

This SDK implement :

  • Multi-layer encryption of all configuration
  • 20+ obfuscation techniques applied during build
  • Anti-debugging protection with runtime checks
  • Self-defending code that breaks if tampered
  • No plain-text secrets in compiled output

See SECURITY.md for detailed protection information.

Important: Only distribute the dist/ folder. Never expose source code (src/).

Protection Verification

After building, verify that no sensitive information is exposed:

npm run verify

This will scan the compiled code for any plain-text secrets or identifiable information.

License

MIT