@andresaya/edge-tts 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,95 +1,91 @@
1
- # Edge TTS
2
-
3
- **Edge TTS** is a powerful Text-to-Speech (TTS) package that leverages Microsoft's Edge capabilities. This package allows you to synthesize speech from text and manage voice options easily through a command-line interface (CLI).
4
-
5
- ## Features
6
-
7
- - **Text-to-Speech**: Convert text into natural-sounding speech using Microsoft Edge's TTS capabilities.
8
- - **Multiple Voices**: Access a variety of voices to suit your project's needs.
9
- - **Audio Export Options**: Export synthesized audio in different formats (raw, base64, or directly to a file).
10
- - **Command-Line Interface**: Use a simple CLI for easy access to functionality.
11
- - **Easy Integration**: Modular structure allows for easy inclusion in existing projects.
12
-
13
- ## Installation
14
-
15
- You can install Edge TTS via npm. Run the following command in your terminal:
16
-
17
- ```bash
18
- bun add @andresaya/edge-tts
19
- ```
20
- ```bash
21
- npm install @andresaya/edge-tts
22
- ```
23
-
24
-
25
- ## Usage
26
- Command-Line Interface
27
-
28
- You can install Edge TTS via npm. bun Run the following command in your terminal:
29
-
30
- ```bash
31
- npm install -g @andresaya/edge-tts
32
- ```
33
-
34
- ```bash
35
- bun install --global edge-tts
36
- ```
37
-
38
- To synthesize speech from text, use the following command:
39
- ```bash
40
- edge-tts synthesize -t "Hello, world!" -o hello_world_audio
41
- ```
42
-
43
- To list available voices, run:
44
-
45
- ```bash
46
- edge-tts voice-list
47
- ```
48
-
49
- Integration into Your Project
50
- To use Edge TTS in your Bun project, you can import it like this:
51
-
52
- ```js
53
- import { EdgeTTS } from '@andresaya/edge-tts';
54
-
55
- // Initialize the EdgeTTS service
56
- const tts = new EdgeTTS();
57
-
58
- // Get voices
59
- const voices = await tts.getVoices();
60
- console.log(voices); // Display available voices
61
-
62
- // Synthesize text with options for voice, rate, volume, and pitch
63
- await tts.synthesize("Hello, world!", 'en-US-AriaNeural', {
64
- rate: '0%', // Speech rate (range: -100% to 100%)
65
- volume: '0%', // Speech volume (range: -100% to 100%)
66
- pitch: '0Hz' // Voice pitch (range: -100Hz to 100Hz)
67
- });
68
-
69
- // Export synthesized audio in different formats
70
- tts.toBase64(); // Get audio as base64
71
- await tts.toFile("output_audio"); // Save audio to file
72
- await tts.toRaw(); // Get raw audio buffer
73
- ```
74
-
75
- ## Export Options
76
- After synthesizing speech, you can export the audio in various formats:
77
-
78
- - `toBase64`: Returns the audio as a Base64 string.
79
- - `toFile`: Saves the audio to a specified file (e.g., "output.wav").
80
- - `toRaw`: Returns the raw audio stream.
81
-
82
- ## PHP Version
83
- If you want to use Edge TTS with PHP, you can check out the PHP version of this package, [Edge TTS PHP](https://github.com/andresayac/edge-tts-php)
84
-
85
-
86
- ## License
87
- This project is licensed under the GNU General Public License v3 (GPLv3).
88
-
89
- ## Acknowledgments
90
-
91
- We would like to extend our gratitude to the developers and contributors of the following projects for their inspiration and groundwork:
92
-
93
- * https://github.com/rany2/edge-tts/tree/master/examples
94
- * https://github.com/rany2/edge-tts/blob/master/src/edge_tts/util.py
1
+ # Edge TTS
2
+
3
+ **Edge TTS** is a powerful Text-to-Speech (TTS) package that leverages Microsoft's Edge capabilities. This package allows you to synthesize speech from text and manage voice options easily through a command-line interface (CLI).
4
+
5
+ ## Features
6
+
7
+ - **Text-to-Speech**: Convert text into natural-sounding speech using Microsoft Edge's TTS capabilities.
8
+ - **Multiple Voices**: Access a variety of voices to suit your project's needs.
9
+ - **Audio Export Options**: Export synthesized audio in different formats (raw, base64, or directly to a file).
10
+ - **Command-Line Interface**: Use a simple CLI for easy access to functionality.
11
+ - **Easy Integration**: Modular structure allows for easy inclusion in existing projects.
12
+
13
+ ## Installation
14
+
15
+ You can install Edge TTS via npm. Run the following command in your terminal:
16
+
17
+ ```bash
18
+ bun add @andresaya/edge-tts
19
+ ```
20
+ ```bash
21
+ npm install @andresaya/edge-tts
22
+ ```
23
+
24
+
25
+ ## Usage
26
+ Command-Line Interface
27
+
28
+ You can install Edge TTS via npm. bun Run the following command in your terminal:
29
+
30
+ ```bash
31
+ npm install -g @andresaya/edge-tts
32
+ ```
33
+
34
+ To synthesize speech from text, use the following command:
35
+ ```bash
36
+ edge-tts synthesize -t "Hello, world!" -o hello_world_audio
37
+ ```
38
+
39
+ To list available voices, run:
40
+
41
+ ```bash
42
+ edge-tts voice-list
43
+ ```
44
+
45
+ Integration into Your Project
46
+ To use Edge TTS in your Bun project, you can import it like this:
47
+
48
+ ```js
49
+ import { EdgeTTS } from '@andresaya/edge-tts';
50
+
51
+ // Initialize the EdgeTTS service
52
+ const tts = new EdgeTTS();
53
+
54
+ // Get voices
55
+ const voices = await tts.getVoices();
56
+ console.log(voices); // Display available voices
57
+
58
+ // Synthesize text with options for voice, rate, volume, and pitch
59
+ await tts.synthesize("Hello, world!", 'en-US-AriaNeural', {
60
+ rate: '0%', // Speech rate (range: -100% to 100%)
61
+ volume: '0%', // Speech volume (range: -100% to 100%)
62
+ pitch: '0Hz' // Voice pitch (range: -100Hz to 100Hz)
63
+ });
64
+
65
+ // Export synthesized audio in different formats
66
+ tts.toBase64(); // Get audio as base64
67
+ await tts.toFile("output_audio"); // Save audio to file
68
+ await tts.toRaw(); // Get raw audio buffer
69
+ ```
70
+
71
+ ## Export Options
72
+ After synthesizing speech, you can export the audio in various formats:
73
+
74
+ - `toBase64`: Returns the audio as a Base64 string.
75
+ - `toFile`: Saves the audio to a specified file (e.g., "output.wav").
76
+ - `toRaw`: Returns the raw audio stream.
77
+
78
+ ## PHP Version
79
+ If you want to use Edge TTS with PHP, you can check out the PHP version of this package, [Edge TTS PHP](https://github.com/andresayac/edge-tts-php)
80
+
81
+
82
+ ## License
83
+ This project is licensed under the GNU General Public License v3 (GPLv3).
84
+
85
+ ## Acknowledgments
86
+
87
+ We would like to extend our gratitude to the developers and contributors of the following projects for their inspiration and groundwork:
88
+
89
+ * https://github.com/rany2/edge-tts/tree/master/examples
90
+ * https://github.com/rany2/edge-tts/blob/master/src/edge_tts/util.py
95
91
  * https://github.com/hasscc/hass-edge-tts/blob/main/custom_components/edge_tts/tts.py
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const SynthesizeCommand_1 = require("../commands/SynthesizeCommand");
5
- const VoiceListCommand_1 = require("../commands/VoiceListCommand");
6
- const commander_1 = require("commander");
7
- const program = new commander_1.Command();
2
+ import { SynthesizeCommand } from '../commands/SynthesizeCommand';
3
+ import { VoiceListCommand } from '../commands/VoiceListCommand';
4
+ import { Command } from 'commander';
5
+ const program = new Command();
8
6
  program
9
- .version('1.2.0')
10
- .addCommand(SynthesizeCommand_1.SynthesizeCommand)
11
- .addCommand(VoiceListCommand_1.VoiceListCommand);
7
+ .version('1.2.6')
8
+ .addCommand(SynthesizeCommand)
9
+ .addCommand(VoiceListCommand);
12
10
  try {
13
11
  program.parse();
14
12
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SynthesizeCommand = void 0;
4
- const commander_1 = require("commander");
5
- const EdgeTTS_1 = require("../services/EdgeTTS");
6
- exports.SynthesizeCommand = new commander_1.Command('synthesize')
1
+ import { Command } from 'commander';
2
+ import { EdgeTTS } from '../services/EdgeTTS';
3
+ export const SynthesizeCommand = new Command('synthesize')
7
4
  .description('Edge TTS: synthesize text to audio')
8
5
  .option('-t, --text <text>', 'Text to convert to audio')
9
6
  .option('-v, --voice [voice]', 'Voice to use for the audio synthesis', 'en-US-AriaNeural')
@@ -17,7 +14,7 @@ exports.SynthesizeCommand = new commander_1.Command('synthesize')
17
14
  console.error('Text is required');
18
15
  process.exit(1);
19
16
  }
20
- const tts = new EdgeTTS_1.EdgeTTS();
17
+ const tts = new EdgeTTS();
21
18
  await tts.synthesize(text, voice, { pitch, rate, volume });
22
19
  await tts.toFile(`${output}`);
23
20
  console.log(`Audio file generated: ${output}.mp3`);
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VoiceListCommand = void 0;
4
- const commander_1 = require("commander");
5
- const EdgeTTS_1 = require("../services/EdgeTTS");
6
- exports.VoiceListCommand = new commander_1.Command('voice-list')
1
+ import { Command } from 'commander';
2
+ import { EdgeTTS } from '../services/EdgeTTS';
3
+ export const VoiceListCommand = new Command('voice-list')
7
4
  .description('Get the list of available voices')
8
5
  .action(async () => {
9
- const tts = new EdgeTTS_1.EdgeTTS();
6
+ const tts = new EdgeTTS();
10
7
  const voices = await tts.getVoices();
11
8
  console.log('Lista de voces disponibles:');
12
9
  voices.forEach((voice) => {
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Constants = void 0;
4
- exports.Constants = {
1
+ export const Constants = {
5
2
  TRUSTED_CLIENT_TOKEN: '6A5AA1D4EAFF4E9FB37E23D68491D6F4',
6
3
  WSS_URL: 'wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1',
7
4
  VOICES_URL: 'https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list',
package/dist/index.js CHANGED
@@ -1,5 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EdgeTTS = void 0;
4
- var EdgeTTS_1 = require("./services/EdgeTTS");
5
- Object.defineProperty(exports, "EdgeTTS", { enumerable: true, get: function () { return EdgeTTS_1.EdgeTTS; } });
1
+ export { EdgeTTS } from './services/EdgeTTS';
@@ -1,18 +1,28 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EdgeTTS = void 0;
7
- const ws_1 = __importDefault(require("ws"));
8
- const constants_1 = require("../config/constants");
9
- const fs_1 = require("fs");
10
- class EdgeTTS {
1
+ import WebSocket, {} from 'ws';
2
+ import { Constants } from '../config/constants';
3
+ import { writeFile } from 'fs/promises';
4
+ import { Buffer } from 'buffer';
5
+ function ensureBuffer(data) {
6
+ if (Buffer.isBuffer(data)) {
7
+ return data;
8
+ }
9
+ if (data instanceof ArrayBuffer) {
10
+ return Buffer.from(data);
11
+ }
12
+ if (Array.isArray(data)) {
13
+ return Buffer.concat(data);
14
+ }
15
+ if (typeof data === 'string') {
16
+ return Buffer.from(data, 'utf-8');
17
+ }
18
+ throw new Error(`Unsupported RawData type: ${typeof data}`);
19
+ }
20
+ export class EdgeTTS {
11
21
  audio_stream = [];
12
22
  audio_format = 'mp3';
13
23
  ws;
14
24
  async getVoices() {
15
- const response = await fetch(`${constants_1.Constants.VOICES_URL}?trustedclienttoken=${constants_1.Constants.TRUSTED_CLIENT_TOKEN}`);
25
+ const response = await fetch(`${Constants.VOICES_URL}?trustedclienttoken=${Constants.TRUSTED_CLIENT_TOKEN}`);
16
26
  const data = await response.json();
17
27
  return data.map((voice) => {
18
28
  delete voice.VoiceTag;
@@ -29,28 +39,56 @@ class EdgeTTS {
29
39
  });
30
40
  }
31
41
  validatePitch(pitch) {
32
- if (!/^(-?\d{1,3}Hz)$/.test(pitch)) {
33
- throw new Error("Invalid pitch format. Expected format: '-100Hz to 100Hz'.");
42
+ if (typeof pitch === 'number') {
43
+ return (pitch >= 0 ? `+${pitch}Hz` : `${pitch}Hz`);
44
+ }
45
+ if (!/^[+-]?\d{1,3}(?:\.\d+)?Hz$/.test(pitch)) {
46
+ throw new Error("Invalid pitch format. Expected format: '-100Hz to +100Hz' or a number.");
34
47
  }
35
48
  return pitch;
36
49
  }
37
50
  validateRate(rate) {
38
- if (!/^(-?\d{1,3}%)$/.test(rate)) {
39
- throw new Error("Invalid rate format. Expected format: '-100% to 100%'.");
51
+ let rateValue;
52
+ if (typeof rate === 'string') {
53
+ rateValue = parseFloat(rate.replace('%', ''));
54
+ if (isNaN(rateValue))
55
+ throw new Error("Invalid rate format.");
56
+ }
57
+ else {
58
+ rateValue = rate;
59
+ }
60
+ if (rateValue >= 0) {
61
+ return `+${rateValue}%`;
40
62
  }
41
- return rate;
63
+ return `${rateValue}%`;
42
64
  }
43
65
  validateVolume(volume) {
44
- if (!/^(-?\d{1,3}%)$/.test(volume)) {
45
- throw new Error("Invalid volume format. Expected format: '-100% to 100%'.");
66
+ let volumeValue;
67
+ if (typeof volume === 'string') {
68
+ volumeValue = parseInt(volume.replace('%', ''), 10);
69
+ if (isNaN(volumeValue))
70
+ throw new Error("Invalid volume format.");
71
+ }
72
+ else {
73
+ volumeValue = volume;
46
74
  }
47
- return volume;
75
+ if (volumeValue < -100 || volumeValue > 100) {
76
+ throw new Error("Volume cannot be negative. Expected a value from -100% to 100% (or more).");
77
+ }
78
+ return `${volumeValue}%`;
48
79
  }
49
80
  async synthesize(text, voice = 'en-US-AnaNeural', options = {}) {
50
81
  return new Promise((resolve, reject) => {
82
+ this.audio_stream = [];
51
83
  const req_id = this.generateUUID();
52
- this.ws = new ws_1.default(`${constants_1.Constants.WSS_URL}?trustedclienttoken=${constants_1.Constants.TRUSTED_CLIENT_TOKEN}&ConnectionId=${req_id}`);
84
+ this.ws = new WebSocket(`${Constants.WSS_URL}?trustedclienttoken=${Constants.TRUSTED_CLIENT_TOKEN}&ConnectionId=${req_id}`);
53
85
  const SSML_text = this.getSSML(text, voice, options);
86
+ const timeout = setTimeout(() => {
87
+ if (this.ws && this.ws.readyState === WebSocket.OPEN) {
88
+ this.ws.close();
89
+ }
90
+ reject(new Error("Synthesis timeout"));
91
+ }, 30000);
54
92
  this.ws.on('open', () => {
55
93
  const message = this.buildTTSConfigMessage();
56
94
  this.ws.send(message);
@@ -60,19 +98,26 @@ class EdgeTTS {
60
98
  this.ws.on('message', (data) => {
61
99
  this.processAudioData(data);
62
100
  });
63
- this.ws.on('close', () => {
64
- resolve();
65
- });
66
101
  this.ws.on('error', (err) => {
102
+ clearTimeout(timeout);
103
+ if (this.ws && this.ws.readyState === WebSocket.OPEN) {
104
+ this.ws.close();
105
+ }
67
106
  reject(err);
68
107
  });
108
+ this.ws.on('close', () => {
109
+ clearTimeout(timeout);
110
+ resolve();
111
+ });
69
112
  });
70
113
  }
71
114
  getSSML(text, voice, options = {}) {
72
- options.pitch = options.pitch.replace('hz', 'Hz');
73
- const pitch = this.validatePitch(options.pitch || '0Hz');
74
- const rate = this.validateRate(options.rate || '0%');
75
- const volume = this.validateVolume(options.volume || '0%');
115
+ if (typeof options.pitch === 'string') {
116
+ options.pitch = options.pitch.replace('hz', 'Hz');
117
+ }
118
+ const pitch = this.validatePitch(options.pitch ?? 0);
119
+ const rate = this.validateRate(options.rate ?? 0);
120
+ const volume = this.validateVolume(options.volume ?? 0);
76
121
  return `<speak version='1.0' xml:lang='en-US'><voice name='${voice}'><prosody pitch='${pitch}' rate='${rate}' volume='${volume}'>${text}</prosody></voice></speak>`;
77
122
  }
78
123
  buildTTSConfigMessage() {
@@ -80,39 +125,33 @@ class EdgeTTS {
80
125
  `{"context":{"synthesis":{"audio":{"metadataoptions":{"sentenceBoundaryEnabled":false,"wordBoundaryEnabled":true},"outputFormat":"audio-24khz-48kbitrate-mono-mp3"}}}}`;
81
126
  }
82
127
  processAudioData(data) {
83
- if (Buffer.isBuffer(data)) {
84
- const needle = Buffer.from("Path:audio\r\n");
85
- const uint8Data = new Uint8Array(data);
86
- const start_ind = uint8Data.indexOf(needle[0]);
87
- if (start_ind !== -1) {
88
- const audioData = data.subarray(start_ind + needle.length);
89
- this.audio_stream.push(audioData);
90
- }
91
- if (data.includes("Path:turn.end")) {
92
- this.ws.close();
93
- }
128
+ const buffer = ensureBuffer(data);
129
+ const needle = Buffer.from("Path:audio\r\n");
130
+ const audioStartIndex = buffer.indexOf(new Uint8Array(needle));
131
+ if (audioStartIndex !== -1) {
132
+ const audioChunk = buffer.subarray(audioStartIndex + needle.length);
133
+ this.audio_stream.push(new Uint8Array(audioChunk));
134
+ }
135
+ if (buffer.toString().includes("Path:turn.end")) {
136
+ this.ws?.close();
94
137
  }
95
138
  }
96
139
  async toFile(outputPath) {
97
- if (this.audio_stream.length) {
98
- const audioBuffer = Buffer.concat(this.audio_stream);
99
- const uint8Array = new Uint8Array(audioBuffer);
100
- (0, fs_1.writeFileSync)(`${outputPath}.${this.audio_format}`, uint8Array);
101
- }
102
- else {
103
- throw new Error("No audio data available to save.");
104
- }
140
+ const audioBuffer = this.toBuffer();
141
+ const finalPath = `${outputPath}.${this.audio_format}`;
142
+ await writeFile(finalPath, new Uint8Array(audioBuffer));
143
+ return finalPath;
105
144
  }
106
145
  toRaw() {
107
- if (this.audio_stream.length === 0) {
108
- throw new Error("No audio data available.");
109
- }
110
- const audioBuffer = Buffer.concat(this.audio_stream);
111
- return audioBuffer.toString('base64');
146
+ return this.toBase64();
112
147
  }
113
148
  toBase64() {
114
- const audioBuffer = Buffer.concat(this.audio_stream);
115
- return audioBuffer.toString('base64');
149
+ return this.toBuffer().toString('base64');
150
+ }
151
+ toBuffer() {
152
+ if (this.audio_stream.length === 0) {
153
+ throw new Error("No audio data available. Did you run synthesize() first?");
154
+ }
155
+ return Buffer.concat(this.audio_stream);
116
156
  }
117
157
  }
118
- exports.EdgeTTS = EdgeTTS;
package/package.json CHANGED
@@ -1,47 +1,48 @@
1
- {
2
- "name": "@andresaya/edge-tts",
3
- "version": "1.2.4",
4
- "description": "Edge TTS is a package that allows access to the online text-to-speech service used by Microsoft Edge without the need for Microsoft Edge, Windows, or an API key.",
5
- "main": "dist/index.js",
6
- "keywords": [
7
- "edge",
8
- "tts",
9
- "text-to-speech",
10
- "microsoft",
11
- "microsoft edge",
12
- "speech-synthesis"
13
- ],
14
- "author": "Andres Aya",
15
- "license": "GPL-3.0-only",
16
- "homepage": "https://github.com/andresayac/edge-tts",
17
- "bugs": {
18
- "url": "https://github.com/andresayac/edge-tts/issues"
19
- },
20
- "scripts": {
21
- "build": "tsc",
22
- "build:bin": "bun scripts/build.ts"
23
- },
24
- "devDependencies": {
25
- "@types/bun": "latest",
26
- "typescript": "^5.6.2"
27
- },
28
- "dependencies": {
29
- "@types/uuid": "^10.0.0",
30
- "commander": "^12.1.0",
31
- "events": "^3.3.0",
32
- "fs": "^0.0.1-security",
33
- "ws": "^8.18.0"
34
- },
35
- "peerDependencies": {
36
- "typescript": "^5.0.0"
37
- },
38
- "files": [
39
- "dist"
40
- ],
41
- "bin": {
42
- "edge-tts": "./dist/cli/edge-tts.js"
43
- },
44
- "engines": {
45
- "bun": ">=0.5.0"
46
- }
47
- }
1
+ {
2
+ "name": "@andresaya/edge-tts",
3
+ "version": "1.2.6",
4
+ "description": "Edge TTS is a package that allows access to the online text-to-speech service used by Microsoft Edge without the need for Microsoft Edge, Windows, or an API key.",
5
+ "main": "dist/index.js",
6
+ "keywords": [
7
+ "edge",
8
+ "tts",
9
+ "text-to-speech",
10
+ "microsoft",
11
+ "microsoft edge",
12
+ "speech-synthesis"
13
+ ],
14
+ "author": "Andres Aya",
15
+ "license": "GPL-3.0-only",
16
+ "homepage": "https://github.com/andresayac/edge-tts",
17
+ "bugs": {
18
+ "url": "https://github.com/andresayac/edge-tts/issues"
19
+ },
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "build:bin": "bun scripts/build.ts"
23
+ },
24
+ "devDependencies": {
25
+ "@types/bun": "latest",
26
+ "@types/ws": "^8.18.1",
27
+ "typescript": "^5.6.2"
28
+ },
29
+ "dependencies": {
30
+ "@types/uuid": "^10.0.0",
31
+ "commander": "^12.1.0",
32
+ "events": "^3.3.0",
33
+ "fs": "^0.0.1-security",
34
+ "ws": "^8.18.0"
35
+ },
36
+ "peerDependencies": {
37
+ "typescript": "^5.0.0"
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "bin": {
43
+ "edge-tts": "./dist/cli/edge-tts.js"
44
+ },
45
+ "engines": {
46
+ "bun": ">=0.5.0"
47
+ }
48
+ }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const SynthesizeCommand: Command;
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare const VoiceListCommand: Command;
@@ -1,5 +0,0 @@
1
- export declare const Constants: {
2
- TRUSTED_CLIENT_TOKEN: string;
3
- WSS_URL: string;
4
- VOICES_URL: string;
5
- };
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { EdgeTTS } from './services/EdgeTTS';
@@ -1,17 +0,0 @@
1
- export declare class EdgeTTS {
2
- private audio_stream;
3
- private audio_format;
4
- private ws;
5
- getVoices(): Promise<any[]>;
6
- private generateUUID;
7
- private validatePitch;
8
- private validateRate;
9
- private validateVolume;
10
- synthesize(text: string, voice?: string, options?: any): Promise<void>;
11
- private getSSML;
12
- private buildTTSConfigMessage;
13
- private processAudioData;
14
- toFile(outputPath: string): Promise<void>;
15
- toRaw(): string;
16
- toBase64(): string;
17
- }