Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

msedge-tts-browserify

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msedge-tts-browserify

An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

MsEdgeTTS

npm version

msedge-tts-browserify clone from Migushthe2nd/MsEdgeTTS, which based on nodejs. To better use it on browser, I rewrite some codes--remove node stream, fs and crypto, replace axios with fetch. This repo only support browser but nodejs.

An simple Azure Speech Service module that uses the Microsoft Edge Read Aloud API.

Full support for SSML Only supports speak, voice, and prosody element types. The following is the default SSML object:

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts"
       xml:lang="${this._voiceLang}">
    <voice name="${voiceName}">
        <prosody rate="${rate}" pitch="${pitch}" volume="${volume}">
            ${input}
        </prosody>
    </voice>
</speak>

Documentation on the SSML format can be found here . All supported audio formats can be found here.

Example usage

Make sure to escape/sanitize your user's input! Use a library like xml-escape.

Write to stream

import { MsEdgeTTS, OUTPUT_FORMAT } from "msedge-tts";

const tts = new MsEdgeTTS();
await tts.setMetadata("en-IE-ConnorNeural", OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS);
const readable = tts.toStream("Hi, how are you?");

readable.on("data", (data) => {
    console.log("DATA RECEIVED", data);
    // raw audio file data
});

readable.on("close", () => {
    console.log("STREAM CLOSED");
});

API

This library only supports promises.

FAQs

Package last updated on 15 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc