Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
edge-tts-node
Advanced tools
An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.
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.
Make sure to escape/sanitize your user's input! Use a library like xml-escape.
import { MsEdgeTTS, OUTPUT_FORMAT } from "edge-tts-node";
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");
});
import { MsEdgeTTS, OUTPUT_FORMAT } from "edge-tts-node";
(async () => {
const tts = new MsEdgeTTS();
await tts.setMetadata(
"en-US-AriaNeural",
OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS
);
const filePath = await tts.toFile("./example_audio.webm", "Hi, how are you?");
})();
import { MsEdgeTTS, OUTPUT_FORMAT } from "edge-tts-node";
(async () => {
const tts = new MsEdgeTTS();
await tts.setMetadata(
"en-US-AriaNeural",
OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS
);
const filePath = await tts.toFile(
"./example_audio.webm",
"Hi, how are you?",
{ rate: 0.5, pitch: "+200Hz" }
);
})();
Use a custom http.Agent implementation like https-proxy-agent or socks-proxy-agent.
import { SocksProxyAgent } from "socks-proxy-agent";
(async () => {
const agent = new SocksProxyAgent(
"socks://your-name%40gmail.com:abcdef12345124@br41.nordvpn.com"
);
const tts = new MsEdgeTTS(agent);
await tts.setMetadata(
"en-US-AriaNeural",
OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS
);
const filePath = await tts.toFile("./example_audio.webm", "Hi, how are you?");
})();
For the full documentation check out the API Documentation.
This library only supports promises.
FAQs
An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.
The npm package edge-tts-node receives a total of 47 weekly downloads. As such, edge-tts-node popularity was classified as not popular.
We found that edge-tts-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.