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

edge-tts-node

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edge-tts-node - npm Package Compare versions

Comparing version 1.5.5 to 1.5.7

2

dist/Headers.d.ts

@@ -27,2 +27,2 @@ declare const CHROMIUM_MAJOR_VERSION = "130";

};
export { CHROMIUM_MAJOR_VERSION, BASE_HEADERS, WSS_HEADERS, VOICE_HEADERS, };
export { CHROMIUM_MAJOR_VERSION, BASE_HEADERS, WSS_HEADERS, VOICE_HEADERS };

@@ -41,8 +41,3 @@ import { OUTPUT_FORMAT } from "./OUTPUT_FORMAT";

private _log;
/**
* Create a new `MsEdgeTTS` instance.
*
* @param agent (optional, **NOT SUPPORTED IN BROWSER**) Use a custom http.Agent implementation like [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) or [socks-proxy-agent](https://github.com/TooTallNate/proxy-agents/tree/main/packages/socks-proxy-agent).
* @param enableLogger=false whether to enable the built-in logger. This logs connections inits, disconnects, and incoming data to the console
*/
static setToken(token: string): void;
constructor({ agent, headers, enableLogger }: {

@@ -49,0 +44,0 @@ agent?: any;

@@ -68,7 +68,7 @@ "use strict";

static getVoicesUrl() {
const param = (0, SecMSGec_1.generateSecMSGecParam)();
const param = (0, SecMSGec_1.generateSecMSGecParam)(MsEdgeTTS.TRUSTED_CLIENT_TOKEN);
return `https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=${MsEdgeTTS.TRUSTED_CLIENT_TOKEN}${param}`;
}
static getSynthUrl() {
const param = (0, SecMSGec_1.generateSecMSGecParam)();
const param = (0, SecMSGec_1.generateSecMSGecParam)(MsEdgeTTS.TRUSTED_CLIENT_TOKEN);
return `wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=${MsEdgeTTS.TRUSTED_CLIENT_TOKEN}${param}`;

@@ -82,8 +82,5 @@ }

}
/**
* Create a new `MsEdgeTTS` instance.
*
* @param agent (optional, **NOT SUPPORTED IN BROWSER**) Use a custom http.Agent implementation like [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) or [socks-proxy-agent](https://github.com/TooTallNate/proxy-agents/tree/main/packages/socks-proxy-agent).
* @param enableLogger=false whether to enable the built-in logger. This logs connections inits, disconnects, and incoming data to the console
*/
static setToken(token) {
MsEdgeTTS.TRUSTED_CLIENT_TOKEN = token;
}
constructor({ agent = undefined, headers = null, enableLogger = false }) {

@@ -135,3 +132,2 @@ this._agent = agent;

this._ws.onmessage = (m) => {
this._log("type:::::::: ", typeof m.data);
let mdata = m.data;

@@ -341,3 +337,3 @@ if (typeof mdata === 'string') {

destroy(error, callback) {
self._log("+_+_+_+__+_", error);
self._log("stream error:: ", error);
delete self._streams[requestId];

@@ -344,0 +340,0 @@ callback(error);

@@ -1,3 +0,2 @@

export declare function generateSecMSGec(): string;
export declare function generateSecMSGec2(size?: number): string;
export declare function generateSecMSGecParam(): string;
export declare function generateSecMsGecToken(token: string): string;
export declare function generateSecMSGecParam(token: string): string;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateSecMSGec = generateSecMSGec;
exports.generateSecMSGec2 = generateSecMSGec2;
exports.generateSecMsGecToken = generateSecMsGecToken;
exports.generateSecMSGecParam = generateSecMSGecParam;
const crypto_1 = __importDefault(require("crypto"));
function generateSecMSGec() {
const randomBytes = crypto_1.default.randomBytes(32);
return randomBytes.toString("hex");
const node_crypto_1 = require("node:crypto");
const WINDOWS_FILE_TIME_EPOCH = 11644473600n;
function generateSecMsGecToken(token) {
const ticks = BigInt(Math.floor(Date.now() / 1000) + Number(WINDOWS_FILE_TIME_EPOCH)) *
10000000n;
const roundedTicks = ticks - (ticks % 3000000000n);
const strToHash = `${roundedTicks}${token}`;
const hash = (0, node_crypto_1.createHash)("sha256");
hash.update(strToHash, "ascii");
return hash.digest("hex").toUpperCase();
}
function generateSecMSGec2(size = 64) {
return [...Array(size)]
.map(() => Math.floor(Math.random() * 16).toString(16))
.join("")
.toUpperCase();
}
function generateSecMSGecParam() {
return "";
const version = "1-114.0.1823.67";
const gec = generateSecMSGec2().toUpperCase();
function generateSecMSGecParam(token) {
const version = "1-130.0.2849.68";
const gec = generateSecMsGecToken(token);
return `&Sec-MS-GEC=${gec}&Sec-MS-GEC-Version=${version}`;
}
{
"name": "edge-tts-node",
"version": "1.5.5",
"version": "1.5.7",
"description": "An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.",

@@ -5,0 +5,0 @@ "author": "Migushthe2nd <Migushthe2nd@users.noreply.github.com>",

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