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

@devsobrinho/edge-tts

v1.1.0

Published

Server-side implementation of the Edge TTS package — utilizing the Microsoft Edge Read Aloud API to generate text-to-speech with support for data streaming or Base64 encoding

Readme

Edge TTS Server-Side Package

Server-side implementation of the Edge TTS package — utilizing the Microsoft Edge Read Aloud API to generate text-to-speech with support for data streaming or Base64 encoding.

Features

  • Text-to-Speech Conversion: Effortlessly convert text into natural-sounding speech using Microsoft Edge's TTS capabilities.
  • Voice Customization: Access a wide range of voices and adjust rate, volume, and pitch to tailor the output for your project.
  • Flexible Audio Output: Export synthesized audio in various formats including streaming, raw audio, or Base64-encoded output.

Installation

Install the Edge TTS package via npm or bun by running one of the following commands:

npm install @devsobrinho/edge-tts
yarn add @devsobrinho/edge-tts
bun add @devsobrinho/edge-tts

Configuration Options

The EdgeTTS package allows for configuration either globally or on a per-method basis:

  • Global Configuration: Pass a configuration object to the constructor for a persistent setup.
  • Dynamic Method Configuration: Optionally override global settings by passing a configuration object to individual methods (toRaw, toBase64, or toStream).

The EdgeTTSSynthesizeConfig interface defines the following configurable options:

export interface EdgeTTSSynthesizeConfig {
  voice?: string;
  rate: RATE | string | number;
  volume: VOLUME | string | number;
  pitch: PITCH | string;
  voiceLocale?: string;
  outputFormat?: OUTPUT_FORMAT;
}

Usage Examples

Streaming Output

The following example shows how to stream the generated audio data:

import { EdgeTTS } from "@devsobrinho/edge-tts";
import { PassThrough } from "stream";

const abortController = new AbortController();
const stream = new PassThrough({ signal: abortController.signal });
const edgeTTS = new EdgeTTS();

await edgeTTS.toStream(
  stream,
  "Hello, my name is Francisca, and I am your virtual assistant.",
  {
    voice:
      "Microsoft Server Speech Text to Speech Voice (pt-BR, FranciscaNeural)",
    volume: "50%",
  }
);

stream.on("data", (data) => {
  console.log("Data chunk received:", data);
});

stream.on("close", () => {
  console.log("Stream closed.");
});

stream.on("error", (err) => {
  console.error("Stream error:", err);
});

Base64 Output

For projects where Base64 encoding is more suitable, here’s an example:

import { EdgeTTS } from "@devsobrinho/edge-tts";

const edgeTTS = new EdgeTTS();

const base64Audio = await edgeTTS.toBase64(
  "Hello, my name is Francisca, and I am your virtual assistant.",
  {
    voice:
      "Microsoft Server Speech Text to Speech Voice (pt-BR, FranciscaNeural)",
    volume: "50%",
  }
);

console.log("Base64 Audio:", base64Audio);

Acknowledgments

We would like to thank the developers and contributors of related projects for their valuable groundwork and inspiration, including: