@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 +90 -94
- package/dist/cli/edge-tts.js +7 -9
- package/dist/commands/SynthesizeCommand.js +4 -7
- package/dist/commands/VoiceListCommand.js +4 -7
- package/dist/config/constants.js +1 -4
- package/dist/index.js +1 -5
- package/dist/services/EdgeTTS.js +93 -54
- package/package.json +48 -47
- package/dist/cli/edge-tts.d.ts +0 -2
- package/dist/commands/SynthesizeCommand.d.ts +0 -2
- package/dist/commands/VoiceListCommand.d.ts +0 -2
- package/dist/config/constants.d.ts +0 -5
- package/dist/index.d.ts +0 -1
- package/dist/services/EdgeTTS.d.ts +0 -17
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
##
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
package/dist/cli/edge-tts.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
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.
|
|
10
|
-
.addCommand(
|
|
11
|
-
.addCommand(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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) => {
|
package/dist/config/constants.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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';
|
package/dist/services/EdgeTTS.js
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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(`${
|
|
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 (
|
|
33
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
|
63
|
+
return `${rateValue}%`;
|
|
42
64
|
}
|
|
43
65
|
validateVolume(volume) {
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
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
|
-
"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
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
}
|
package/dist/cli/edge-tts.d.ts
DELETED
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
|
-
}
|