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

edge-tts.js

v2.0.3

Published

Use Microsoft Edge's online text-to-speech service from TypeScript / JavaScript WITHOUT needing Microsoft Edge or Windows or an API key

Downloads

35

Readme

edge-tts.js

edge-tts.js is a Node.js module that lets you use Microsoft Edge's online text-to-speech service. You can use it in your JavaScript code or via the provided edge-tts.js command-line tool.


Installation

To install the package, run one of the following commands:

$ npm install edge-tts.js

Or, to use it as a command-line tool without a local installation, you can use npx:

$ npx edge-tts.js

Usage

Basic Usage

$ npm i edge-tts.js
import { listVoices, Communicate } from 'edge-tts.js'

// List available voices
const voices = await listVoices()
console.log('Available voices:', voices)

// Create a new Communicate instance
const communicate = new Communicate("即使才能不足,但只要有热情,孜孜以求,成绩可以不亚于人。", "zh-CN-XiaoxiaoNeural")
await communicate.save("hello.mp3")

▶️ Streaming Audio Example Online Playground

To use the edge-tts.js command, simply run it with your desired text.

$ npx edge-tts.js --text "Hello, world!" --write-media hello.mp3 --write-subtitles hello.srt

Changing the Voice

You can change the voice for the text-to-speech service using the --voice option. To see a list of all available voices, use the --list-voices option.

$ npx edge-tts.js --list-voices

This will output a list of voices similar to this:

┌───────────────────────────────────┬────────┬───────────────────────┬────────────────────────────────────────┐
│ Name                              │ Gender │ ContentCategories     │ VoicePersonalities                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ af-ZA-AdriNeural                  │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ az-AZ-BanuNeural                  │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ bg-BG-BorislavNeural              │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ bn-IN-TanishaaNeural              │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ bs-BA-GoranNeural                 │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ ca-ES-EnricNeural                 │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ cs-CZ-AntoninNeural               │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ cy-GB-NiaNeural                   │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ da-DK-ChristelNeural              │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ de-AT-IngridNeural                │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ el-GR-AthinaNeural                │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-AU-WilliamMultilingualNeural   │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-CA-ClaraNeural                 │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-CA-LiamNeural                  │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-GB-LibbyNeural                 │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-GB-RyanNeural                  │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-GB-SoniaNeural                 │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-GB-ThomasNeural                │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-SG-LunaNeural                  │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-SG-WayneNeural                 │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-TZ-ImaniNeural                 │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AnaNeural                   │ Female │ Cartoon, Conversation │ Cute                                   │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AndrewMultilingualNeural    │ Male   │ Conversation, Copilot │ Warm, Confident, Authentic, Honest     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AndrewNeural                │ Male   │ Conversation, Copilot │ Warm, Confident, Authentic, Honest     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AriaNeural                  │ Female │ News, Novel           │ Positive, Confident                    │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AvaMultilingualNeural       │ Female │ Conversation, Copilot │ Expressive, Caring, Pleasant, Friendly │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-AvaNeural                   │ Female │ Conversation, Copilot │ Expressive, Caring, Pleasant, Friendly │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-BrianMultilingualNeural     │ Male   │ Conversation, Copilot │ Approachable, Casual, Sincere          │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-BrianNeural                 │ Male   │ Conversation, Copilot │ Approachable, Casual, Sincere          │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-ChristopherNeural           │ Male   │ News, Novel           │ Reliable, Authority                    │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-EmmaMultilingualNeural      │ Female │ Conversation, Copilot │ Cheerful, Clear, Conversational        │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-EmmaNeural                  │ Female │ Conversation, Copilot │ Cheerful, Clear, Conversational        │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-EricNeural                  │ Male   │ News, Novel           │ Rational                               │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-GuyNeural                   │ Male   │ News, Novel           │ Passion                                │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-JennyNeural                 │ Female │ General               │ Friendly, Considerate, Comfort         │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-MichelleNeural              │ Female │ News, Novel           │ Friendly, Pleasant                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-RogerNeural                 │ Male   │ News, Novel           │ Lively                                 │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ en-US-SteffanNeural               │ Male   │ News, Novel           │ Rational                               │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ es-PA-RobertoNeural               │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ es-UY-ValentinaNeural             │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ es-VE-PaolaNeural                 │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ et-EE-KertNeural                  │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fa-IR-DilaraNeural                │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fi-FI-HarriNeural                 │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fil-PH-AngeloNeural               │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fr-BE-CharlineNeural              │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fr-FR-EloiseNeural                │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fr-FR-RemyMultilingualNeural      │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ fr-FR-VivienneMultilingualNeural  │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ ga-IE-ColmNeural                  │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ ga-IE-OrlaNeural                  │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ gl-ES-RoiNeural                   │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ ...                               │ ...    │ ...                   │ ...                                    │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ ...                               │ ...    │ ...                   │ ...                                    │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-liaoning-XiaobeiNeural      │ Female │ Dialect               │ Humorous                               │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-shaanxi-XiaoniNeural        │ Female │ Dialect               │ Bright                                 │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-XiaoxiaoNeural              │ Female │ News, Novel           │ Warm                                   │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-XiaoyiNeural                │ Female │ Cartoon, Novel        │ Lively                                 │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-YunjianNeural               │ Male   │ Sports, Novel         │ Passion                                │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-YunxiaNeural                │ Male   │ Cartoon, Novel        │ Cute                                   │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-YunxiNeural                 │ Male   │ Novel                 │ Lively, Sunshine                       │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-CN-YunyangNeural               │ Male   │ News                  │ Professional, Reliable                 │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-HK-HiuGaaiNeural               │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-HK-HiuMaanNeural               │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-HK-WanLungNeural               │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-TW-HsiaoChenNeural             │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-TW-HsiaoYuNeural               │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zh-TW-YunJheNeural                │ Male   │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zu-ZA-ThandoNeural                │ Female │ General               │ Friendly, Positive                     │
├───────────────────────────────────┼────────┼───────────────────────┼────────────────────────────────────────┤
│ zu-ZA-ThembaNeural                │ Male   │ General               │ Friendly, Positive                     │
└───────────────────────────────────┴────────┴───────────────────────┴────────────────────────────────────────┘

To specify a voice, use the --voice flag:

$ npx edge-tts.js --voice ar-EG-SalmaNeural --text "مرحبا كيف حالك؟" --write-media hello_in_arabic.mp3 --write-subtitles hello_in_arabic.srt

Custom SSML

edge-tts.js supports custom SSML, but it's important to note that Microsoft's service has limitations. It only allows a single <voice> tag with a single <prosody> tag inside. Any customization options that can be used within the <prosody> tag are already available through the library or command-line options.

Adjusting Rate, Volume, and Pitch

You can control the rate, volume, and pitch of the generated speech with the --rate, --volume, and --pitch options. When using a negative value, you need to use the format --[option]=-50% to prevent the option from being interpreted as a separate argument.

$ npx edge-tts.js --rate=-50% --text "Hello, world!" --write-media hello_rate.mp3
$ npx edge-tts.js --volume=-50% --text "Hello, world!" --write-media hello_volume.mp3
$ npx edge-tts.js --pitch=-50Hz --text "Hello, world!" --write-media hello_pitch.mp3

JavaScript Module

You can also use the edge-tts.js module directly within your JavaScript code. For usage examples, check out the following link: example code link