@elizaos/plugin-edge-tts 2.0.0-alpha.9 → 2.0.11-beta.7

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @elizaos/plugin-edge-tts
2
2
 
3
- Free text-to-speech plugin for ElizaOS using Microsoft Edge TTS. No API key required.
3
+ Free text-to-speech plugin for elizaOS using Microsoft Edge TTS. No API key required.
4
4
 
5
5
  ## Features
6
6
 
@@ -18,7 +18,7 @@ npm install @elizaos/plugin-edge-tts
18
18
 
19
19
  ## Usage
20
20
 
21
- ### As ElizaOS Plugin
21
+ ### As elizaOS Plugin
22
22
 
23
23
  ```typescript
24
24
  import { edgeTTSPlugin } from "@elizaos/plugin-edge-tts";
@@ -90,6 +90,3 @@ Edge TTS is **not available in browser environments** because it requires:
90
90
 
91
91
  For browser TTS, use `@elizaos/plugin-elevenlabs` or `@elizaos/plugin-openai` instead.
92
92
 
93
- ## License
94
-
95
- MIT
package/auto-enable.ts ADDED
@@ -0,0 +1,30 @@
1
+ // Auto-enable check for @elizaos/plugin-edge-tts.
2
+ //
3
+ // Plugin manifest entry-point — referenced by package.json's
4
+ // `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
5
+ // no service init, no transitive imports of the full plugin runtime. The
6
+ // auto-enable engine loads dozens of these per boot.
7
+ import type { PluginAutoEnableContext } from "@elizaos/core";
8
+
9
+ function isFeatureEnabled(
10
+ config: PluginAutoEnableContext["config"],
11
+ key: string,
12
+ ): boolean {
13
+ const f = (config?.features as Record<string, unknown> | undefined)?.[key];
14
+ if (f === true) return true;
15
+ if (f && typeof f === "object" && f !== null) {
16
+ return (f as Record<string, unknown>).enabled !== false;
17
+ }
18
+ return false;
19
+ }
20
+
21
+ /**
22
+ * Enable when the runtime is provisioned by Eliza Cloud, or when the user has
23
+ * explicitly enabled TTS via `config.features.tts`.
24
+ */
25
+ export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
26
+ return (
27
+ ctx.env.ELIZA_CLOUD_PROVISIONED === "1" ||
28
+ isFeatureEnabled(ctx.config, "tts")
29
+ );
30
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-edge-tts",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.11-beta.7",
4
4
  "type": "module",
5
- "main": "dist/cjs/index.node.cjs",
5
+ "main": "dist/node/index.node.js",
6
6
  "module": "dist/node/index.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/browser/index.browser.js",
@@ -16,6 +16,11 @@
16
16
  "./package.json": "./package.json",
17
17
  ".": {
18
18
  "types": "./dist/index.d.ts",
19
+ "eliza-source": {
20
+ "types": "./src/index.node.ts",
21
+ "import": "./src/index.node.ts",
22
+ "default": "./src/index.node.ts"
23
+ },
19
24
  "browser": {
20
25
  "types": "./dist/browser/index.d.ts",
21
26
  "import": "./dist/browser/index.browser.js",
@@ -24,7 +29,6 @@
24
29
  "node": {
25
30
  "types": "./dist/node/index.d.ts",
26
31
  "import": "./dist/node/index.node.js",
27
- "require": "./dist/cjs/index.node.cjs",
28
32
  "default": "./dist/node/index.node.js"
29
33
  },
30
34
  "default": "./dist/node/index.node.js"
@@ -38,31 +42,50 @@
38
42
  "types": "./dist/browser/index.d.ts",
39
43
  "import": "./dist/browser/index.browser.js",
40
44
  "default": "./dist/browser/index.browser.js"
45
+ },
46
+ "./*.css": "./dist/*.css",
47
+ "./*": {
48
+ "types": "./dist/*.d.ts",
49
+ "import": "./dist/*.js",
50
+ "default": "./dist/*.js"
41
51
  }
42
52
  },
43
53
  "files": [
44
- "dist"
54
+ "dist",
55
+ "auto-enable.ts"
45
56
  ],
57
+ "elizaos": {
58
+ "plugin": {
59
+ "autoEnableModule": "./auto-enable.ts",
60
+ "capabilities": [
61
+ "text-to-speech"
62
+ ]
63
+ }
64
+ },
46
65
  "dependencies": {
47
- "@elizaos/core": "alpha",
66
+ "@elizaos/core": "2.0.11-beta.7",
48
67
  "node-edge-tts": "^1.0.7"
49
68
  },
50
69
  "devDependencies": {
70
+ "@biomejs/biome": "^2.4.14",
51
71
  "@types/bun": "^1.2.22",
52
72
  "@types/node": "^24.5.2",
53
- "typescript": "^5.9.2",
54
- "@biomejs/biome": "^2.3.11"
73
+ "bun-types": "1.3.14",
74
+ "typescript": "^6.0.3",
75
+ "vitest": "^4.0.17"
55
76
  },
56
77
  "scripts": {
57
78
  "build": "bun run build.ts",
58
79
  "dev": "bun --hot build.ts",
59
- "test": "npx -y vitest@4.0.18 run --passWithNoTests",
60
- "clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
80
+ "test": "vitest run --config ./vitest.config.ts",
81
+ "clean": "rm -rf dist .turbo .turbo-tsconfig.json tsconfig.tsbuildinfo",
61
82
  "format": "bunx @biomejs/biome format --write .",
62
83
  "format:check": "bunx @biomejs/biome format .",
63
84
  "lint": "bunx @biomejs/biome check --write --unsafe .",
64
85
  "lint:check": "bunx @biomejs/biome check .",
65
- "typecheck": "tsc --noEmit"
86
+ "typecheck": "tsgo --noEmit",
87
+ "test:e2e": "node ../../packages/app-core/scripts/run-local-plugin-live-smoke.mjs",
88
+ "test:live": "bun run test:e2e"
66
89
  },
67
90
  "publishConfig": {
68
91
  "access": "public"
@@ -124,7 +147,7 @@
124
147
  }
125
148
  }
126
149
  },
127
- "milady": {
150
+ "eliza": {
128
151
  "platforms": [
129
152
  "browser",
130
153
  "node"
@@ -134,5 +157,6 @@
134
157
  "browser": "Browser-compatible build available via exports.browser",
135
158
  "node": "Node.js build available via exports.node"
136
159
  }
137
- }
160
+ },
161
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e"
138
162
  }
@@ -1,3 +0,0 @@
1
- import{logger as f}from"@elizaos/core";var j={name:"edge-tts",description:"Edge TTS plugin (browser stub - not available in browser environments)",models:{},tests:[]};if(typeof window<"u")f.warn("[EdgeTTS] Edge TTS is not available in browser environments. Use @elizaos/plugin-elevenlabs or @elizaos/plugin-openai for browser TTS.");var v=j;export{j as edgeTTSPlugin,v as default};
2
-
3
- //# debugId=A1DF4939E5621A8064756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.browser.ts"],
4
- "sourcesContent": [
5
- "/**\n * Browser entry point for @elizaos/plugin-edge-tts\n *\n * Edge TTS is not available in browser environments because it requires\n * Node.js file system access and WebSocket connections that browsers don't support.\n *\n * For browser TTS, use @elizaos/plugin-elevenlabs or @elizaos/plugin-openai instead.\n */\nimport { logger, type Plugin } from \"@elizaos/core\";\n\nexport const edgeTTSPlugin: Plugin = {\n name: \"edge-tts\",\n description: \"Edge TTS plugin (browser stub - not available in browser environments)\",\n models: {},\n tests: [],\n};\n\n// Log warning when imported in browser\nif (typeof window !== \"undefined\") {\n logger.warn(\n \"[EdgeTTS] Edge TTS is not available in browser environments. \" +\n \"Use @elizaos/plugin-elevenlabs or @elizaos/plugin-openai for browser TTS.\"\n );\n}\n\nexport default edgeTTSPlugin;\n"
6
- ],
7
- "mappings": "AAQA,iBAAS,sBAEF,IAAM,EAAwB,CACnC,KAAM,WACN,YAAa,yEACb,OAAQ,CAAC,EACT,MAAO,CAAC,CACV,EAGA,GAAI,OAAO,OAAW,IACpB,EAAO,KACL,wIAEF,EAGF,IAAe",
8
- "debugId": "A1DF4939E5621A8064756E2164756E21",
9
- "names": []
10
- }
@@ -1,2 +0,0 @@
1
- export * from '../index';
2
- export { default } from '../index';
@@ -1,2 +0,0 @@
1
- export * from '../index';
2
- export { default } from '../index';
@@ -1,260 +0,0 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __moduleCache = /* @__PURE__ */ new WeakMap;
19
- var __toCommonJS = (from) => {
20
- var entry = __moduleCache.get(from), desc;
21
- if (entry)
22
- return entry;
23
- entry = __defProp({}, "__esModule", { value: true });
24
- if (from && typeof from === "object" || typeof from === "function")
25
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
26
- get: () => from[key],
27
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
- }));
29
- __moduleCache.set(from, entry);
30
- return entry;
31
- };
32
- var __export = (target, all) => {
33
- for (var name in all)
34
- __defProp(target, name, {
35
- get: all[name],
36
- enumerable: true,
37
- configurable: true,
38
- set: (newValue) => all[name] = () => newValue
39
- });
40
- };
41
-
42
- // src/index.node.ts
43
- var exports_index_node = {};
44
- __export(exports_index_node, {
45
- edgeTTSPlugin: () => edgeTTSPlugin,
46
- default: () => src_default,
47
- _test: () => _test
48
- });
49
- module.exports = __toCommonJS(exports_index_node);
50
-
51
- // src/index.ts
52
- var import_node_fs = require("node:fs");
53
- var import_node_os = require("node:os");
54
- var import_node_path = __toESM(require("node:path"));
55
- var import_core = require("@elizaos/core");
56
- var import_node_edge_tts = require("node-edge-tts");
57
- var DEFAULT_VOICE = "en-US-MichelleNeural";
58
- var DEFAULT_LANG = "en-US";
59
- var DEFAULT_OUTPUT_FORMAT = "audio-24khz-48kbitrate-mono-mp3";
60
- var DEFAULT_TIMEOUT_MS = 30000;
61
- var VOICE_PRESETS = {
62
- alloy: "en-US-GuyNeural",
63
- echo: "en-US-ChristopherNeural",
64
- fable: "en-GB-RyanNeural",
65
- onyx: "en-US-DavisNeural",
66
- nova: "en-US-JennyNeural",
67
- shimmer: "en-US-AriaNeural"
68
- };
69
- function getSetting(runtime, key, fallback) {
70
- const envValue = typeof process !== "undefined" && process.env ? process.env[key] : undefined;
71
- return runtime.getSetting(key) ?? envValue ?? fallback;
72
- }
73
- function getEdgeTTSSettings(runtime) {
74
- const timeoutStr = getSetting(runtime, "EDGE_TTS_TIMEOUT_MS");
75
- return {
76
- voice: getSetting(runtime, "EDGE_TTS_VOICE", DEFAULT_VOICE) ?? DEFAULT_VOICE,
77
- lang: getSetting(runtime, "EDGE_TTS_LANG", DEFAULT_LANG) ?? DEFAULT_LANG,
78
- outputFormat: getSetting(runtime, "EDGE_TTS_OUTPUT_FORMAT", DEFAULT_OUTPUT_FORMAT) ?? DEFAULT_OUTPUT_FORMAT,
79
- rate: getSetting(runtime, "EDGE_TTS_RATE"),
80
- pitch: getSetting(runtime, "EDGE_TTS_PITCH"),
81
- volume: getSetting(runtime, "EDGE_TTS_VOLUME"),
82
- proxy: getSetting(runtime, "EDGE_TTS_PROXY"),
83
- timeoutMs: timeoutStr ? Number.parseInt(timeoutStr, 10) : DEFAULT_TIMEOUT_MS
84
- };
85
- }
86
- function resolveVoice(voice, defaultVoice) {
87
- if (!voice)
88
- return defaultVoice;
89
- const preset = VOICE_PRESETS[voice.toLowerCase()];
90
- if (preset)
91
- return preset;
92
- return voice;
93
- }
94
- function speedToRate(speed) {
95
- if (speed === undefined || speed === 1)
96
- return;
97
- const percentage = Math.round((speed - 1) * 100);
98
- return percentage >= 0 ? `+${percentage}%` : `${percentage}%`;
99
- }
100
- function inferExtension(outputFormat) {
101
- const normalized = outputFormat.toLowerCase();
102
- if (normalized.includes("webm"))
103
- return ".webm";
104
- if (normalized.includes("ogg"))
105
- return ".ogg";
106
- if (normalized.includes("opus"))
107
- return ".opus";
108
- if (normalized.includes("wav") || normalized.includes("riff") || normalized.includes("pcm")) {
109
- return ".wav";
110
- }
111
- return ".mp3";
112
- }
113
- async function generateSpeech(settings, params) {
114
- const voice = resolveVoice(params.voice, settings.voice);
115
- const lang = params.lang ?? settings.lang;
116
- const outputFormat = params.outputFormat ?? settings.outputFormat;
117
- const rate = params.rate ?? speedToRate(params.speed) ?? settings.rate;
118
- const pitch = params.pitch ?? settings.pitch;
119
- const volume = params.volume ?? settings.volume;
120
- import_core.logger.debug(`[EdgeTTS] Generating speech with voice: ${voice}, lang: ${lang}`);
121
- const tts = new import_node_edge_tts.EdgeTTS({
122
- voice,
123
- lang,
124
- outputFormat,
125
- saveSubtitles: false,
126
- proxy: settings.proxy,
127
- rate,
128
- pitch,
129
- volume,
130
- timeout: settings.timeoutMs
131
- });
132
- const tempDir = import_node_fs.mkdtempSync(import_node_path.default.join(import_node_os.tmpdir(), "edge-tts-"));
133
- const extension = inferExtension(outputFormat);
134
- const outputPath = import_node_path.default.join(tempDir, `speech${extension}`);
135
- try {
136
- await tts.ttsPromise(params.text, outputPath);
137
- const audioBuffer = import_node_fs.readFileSync(outputPath);
138
- return audioBuffer;
139
- } finally {
140
- try {
141
- import_node_fs.rmSync(tempDir, { recursive: true, force: true });
142
- } catch {}
143
- }
144
- }
145
- var edgeTTSPlugin = {
146
- name: "edge-tts",
147
- description: "Free text-to-speech synthesis using Microsoft Edge TTS - no API key required, high-quality neural voices",
148
- models: {
149
- [import_core.ModelType.TEXT_TO_SPEECH]: async (runtime, input) => {
150
- const params = typeof input === "string" ? { text: input } : input;
151
- const settings = getEdgeTTSSettings(runtime);
152
- import_core.logger.log(`[EdgeTTS] Using TEXT_TO_SPEECH with voice: ${settings.voice}`);
153
- if (!params.text || params.text.trim().length === 0) {
154
- throw new Error("TEXT_TO_SPEECH requires non-empty text");
155
- }
156
- if (params.text.length > 5000) {
157
- throw new Error("TEXT_TO_SPEECH text exceeds 5000 character limit");
158
- }
159
- try {
160
- const audioBuffer = await generateSpeech(settings, params);
161
- return audioBuffer;
162
- } catch (error) {
163
- const msg = error instanceof Error ? error.message : String(error);
164
- import_core.logger.error(`EdgeTTS model error: ${msg}`);
165
- throw error instanceof Error ? error : new Error(msg);
166
- }
167
- }
168
- },
169
- tests: [
170
- {
171
- name: "test edge tts",
172
- tests: [
173
- {
174
- name: "Edge TTS settings validation",
175
- fn: async (runtime) => {
176
- const settings = getEdgeTTSSettings(runtime);
177
- if (!settings.voice) {
178
- throw new Error("Missing voice configuration");
179
- }
180
- if (!settings.lang) {
181
- throw new Error("Missing language configuration");
182
- }
183
- if (!settings.outputFormat) {
184
- throw new Error("Missing output format configuration");
185
- }
186
- import_core.logger.success("Edge TTS settings validated successfully");
187
- }
188
- },
189
- {
190
- name: "Edge TTS voice preset mapping",
191
- fn: async (_runtime) => {
192
- const testCases = [
193
- { input: "alloy", expected: "en-US-GuyNeural" },
194
- { input: "nova", expected: "en-US-JennyNeural" },
195
- { input: "shimmer", expected: "en-US-AriaNeural" },
196
- {
197
- input: "en-US-MichelleNeural",
198
- expected: "en-US-MichelleNeural"
199
- }
200
- ];
201
- for (const tc of testCases) {
202
- const result = resolveVoice(tc.input, DEFAULT_VOICE);
203
- if (result !== tc.expected) {
204
- throw new Error(`Voice preset mapping failed: ${tc.input} -> ${result}, expected ${tc.expected}`);
205
- }
206
- }
207
- import_core.logger.success("Voice preset mapping validated successfully");
208
- }
209
- },
210
- {
211
- name: "Edge TTS speed to rate conversion",
212
- fn: async (_runtime) => {
213
- const testCases = [
214
- { speed: 1, expected: undefined },
215
- { speed: 1.5, expected: "+50%" },
216
- { speed: 0.75, expected: "-25%" },
217
- { speed: 2, expected: "+100%" }
218
- ];
219
- for (const tc of testCases) {
220
- const result = speedToRate(tc.speed);
221
- if (result !== tc.expected) {
222
- throw new Error(`Speed conversion failed: ${tc.speed} -> ${result}, expected ${tc.expected}`);
223
- }
224
- }
225
- import_core.logger.success("Speed to rate conversion validated successfully");
226
- }
227
- },
228
- {
229
- name: "Edge TTS generation (live test)",
230
- fn: async (runtime) => {
231
- const testText = "Hello, this is a test of Edge TTS.";
232
- try {
233
- const audioBuffer = await runtime.useModel(import_core.ModelType.TEXT_TO_SPEECH, testText);
234
- if (!audioBuffer || audioBuffer.length === 0) {
235
- throw new Error("Received empty audio buffer");
236
- }
237
- import_core.logger.success(`Edge TTS generation successful: ${audioBuffer.length} bytes`);
238
- } catch (error) {
239
- const msg = error instanceof Error ? error.message : String(error);
240
- if (msg.includes("ENOTFOUND") || msg.includes("network")) {
241
- import_core.logger.warn(`Edge TTS live test skipped (network unavailable): ${msg}`);
242
- return;
243
- }
244
- throw error;
245
- }
246
- }
247
- }
248
- ]
249
- }
250
- ]
251
- };
252
- var src_default = edgeTTSPlugin;
253
- var _test = {
254
- resolveVoice,
255
- speedToRate,
256
- inferExtension,
257
- getEdgeTTSSettings
258
- };
259
-
260
- //# debugId=44DEBD6EBE84FDA064756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "sourcesContent": [
5
- "import { mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { type IAgentRuntime, logger, ModelType, type Plugin } from \"@elizaos/core\";\nimport { EdgeTTS } from \"node-edge-tts\";\n\n/**\n * Edge TTS voice settings configuration\n */\ninterface EdgeTTSSettings {\n voice: string;\n lang: string;\n outputFormat: string;\n rate?: string;\n pitch?: string;\n volume?: string;\n proxy?: string;\n timeoutMs: number;\n}\n\n/**\n * Extended TTS params with Edge-specific options\n */\ninterface EdgeTTSParams {\n text: string;\n voice?: string;\n speed?: number;\n /** Edge TTS specific: language code */\n lang?: string;\n /** Edge TTS specific: output format */\n outputFormat?: string;\n /** Edge TTS specific: rate adjustment (e.g., +10%, -5%) */\n rate?: string;\n /** Edge TTS specific: pitch adjustment (e.g., +5Hz, -10Hz) */\n pitch?: string;\n /** Edge TTS specific: volume adjustment (e.g., +20%, -10%) */\n volume?: string;\n}\n\n// Default voice configurations\nconst DEFAULT_VOICE = \"en-US-MichelleNeural\";\nconst DEFAULT_LANG = \"en-US\";\nconst DEFAULT_OUTPUT_FORMAT = \"audio-24khz-48kbitrate-mono-mp3\";\nconst DEFAULT_TIMEOUT_MS = 30000;\n\n// Voice presets mapping common voice names to Edge TTS voices\nconst VOICE_PRESETS: Record<string, string> = {\n // Generic voices (map to good defaults)\n alloy: \"en-US-GuyNeural\",\n echo: \"en-US-ChristopherNeural\",\n fable: \"en-GB-RyanNeural\",\n onyx: \"en-US-DavisNeural\",\n nova: \"en-US-JennyNeural\",\n shimmer: \"en-US-AriaNeural\",\n // Direct Edge TTS voice names pass through\n};\n\nfunction getSetting(runtime: IAgentRuntime, key: string, fallback?: string): string | undefined {\n const envValue =\n typeof process !== \"undefined\" && (process as { env?: Record<string, string> }).env\n ? (process as { env: Record<string, string> }).env[key]\n : undefined;\n return (runtime.getSetting(key) as string | undefined) ?? envValue ?? fallback;\n}\n\nfunction getEdgeTTSSettings(runtime: IAgentRuntime): EdgeTTSSettings {\n const timeoutStr = getSetting(runtime, \"EDGE_TTS_TIMEOUT_MS\");\n return {\n voice: getSetting(runtime, \"EDGE_TTS_VOICE\", DEFAULT_VOICE) ?? DEFAULT_VOICE,\n lang: getSetting(runtime, \"EDGE_TTS_LANG\", DEFAULT_LANG) ?? DEFAULT_LANG,\n outputFormat:\n getSetting(runtime, \"EDGE_TTS_OUTPUT_FORMAT\", DEFAULT_OUTPUT_FORMAT) ?? DEFAULT_OUTPUT_FORMAT,\n rate: getSetting(runtime, \"EDGE_TTS_RATE\"),\n pitch: getSetting(runtime, \"EDGE_TTS_PITCH\"),\n volume: getSetting(runtime, \"EDGE_TTS_VOLUME\"),\n proxy: getSetting(runtime, \"EDGE_TTS_PROXY\"),\n timeoutMs: timeoutStr ? Number.parseInt(timeoutStr, 10) : DEFAULT_TIMEOUT_MS,\n };\n}\n\n/**\n * Resolve voice name - handles OpenAI-style voice names and Edge TTS voice IDs\n */\nfunction resolveVoice(voice: string | undefined, defaultVoice: string): string {\n if (!voice) return defaultVoice;\n\n // Check if it's a preset name\n const preset = VOICE_PRESETS[voice.toLowerCase()];\n if (preset) return preset;\n\n // Assume it's a direct Edge TTS voice ID\n return voice;\n}\n\n/**\n * Convert speed multiplier to Edge TTS rate string\n * speed: 1.0 = normal, 0.5 = half speed, 2.0 = double speed\n */\nfunction speedToRate(speed: number | undefined): string | undefined {\n if (speed === undefined || speed === 1.0) return undefined;\n const percentage = Math.round((speed - 1) * 100);\n return percentage >= 0 ? `+${percentage}%` : `${percentage}%`;\n}\n\n/**\n * Infer file extension from Edge TTS output format\n */\nfunction inferExtension(outputFormat: string): string {\n const normalized = outputFormat.toLowerCase();\n if (normalized.includes(\"webm\")) return \".webm\";\n if (normalized.includes(\"ogg\")) return \".ogg\";\n if (normalized.includes(\"opus\")) return \".opus\";\n if (normalized.includes(\"wav\") || normalized.includes(\"riff\") || normalized.includes(\"pcm\")) {\n return \".wav\";\n }\n return \".mp3\";\n}\n\n/**\n * Generate speech using Microsoft Edge TTS\n */\nasync function generateSpeech(settings: EdgeTTSSettings, params: EdgeTTSParams): Promise<Buffer> {\n const voice = resolveVoice(params.voice, settings.voice);\n const lang = params.lang ?? settings.lang;\n const outputFormat = params.outputFormat ?? settings.outputFormat;\n const rate = params.rate ?? speedToRate(params.speed) ?? settings.rate;\n const pitch = params.pitch ?? settings.pitch;\n const volume = params.volume ?? settings.volume;\n\n logger.debug(`[EdgeTTS] Generating speech with voice: ${voice}, lang: ${lang}`);\n\n const tts = new EdgeTTS({\n voice,\n lang,\n outputFormat,\n saveSubtitles: false,\n proxy: settings.proxy,\n rate,\n pitch,\n volume,\n timeout: settings.timeoutMs,\n });\n\n // Create temp directory for output\n const tempDir = mkdtempSync(path.join(tmpdir(), \"edge-tts-\"));\n const extension = inferExtension(outputFormat);\n const outputPath = path.join(tempDir, `speech${extension}`);\n\n try {\n await tts.ttsPromise(params.text, outputPath);\n const audioBuffer = readFileSync(outputPath);\n return audioBuffer;\n } finally {\n // Cleanup temp directory\n try {\n rmSync(tempDir, { recursive: true, force: true });\n } catch {\n // Ignore cleanup errors\n }\n }\n}\n\n/**\n * Edge TTS Plugin for ElizaOS\n *\n * Provides free text-to-speech synthesis using Microsoft Edge's TTS service.\n * No API key required - uses the same TTS engine as Microsoft Edge browser.\n *\n * Features:\n * - High-quality neural voices\n * - Multiple languages and locales\n * - Adjustable rate, pitch, and volume\n * - No API key or payment required\n *\n * Optional environment variables:\n * - EDGE_TTS_VOICE: Voice ID (default: en-US-MichelleNeural)\n * - EDGE_TTS_LANG: Language code (default: en-US)\n * - EDGE_TTS_OUTPUT_FORMAT: Output format (default: audio-24khz-48kbitrate-mono-mp3)\n * - EDGE_TTS_RATE: Speech rate adjustment (e.g., +10%, -5%)\n * - EDGE_TTS_PITCH: Pitch adjustment (e.g., +5Hz, -10Hz)\n * - EDGE_TTS_VOLUME: Volume adjustment (e.g., +20%, -10%)\n * - EDGE_TTS_PROXY: HTTP proxy URL\n * - EDGE_TTS_TIMEOUT_MS: Request timeout (default: 30000)\n *\n * Popular voices:\n * - en-US-MichelleNeural (female, US English)\n * - en-US-GuyNeural (male, US English)\n * - en-US-JennyNeural (female, US English)\n * - en-US-AriaNeural (female, US English)\n * - en-GB-SoniaNeural (female, UK English)\n * - en-GB-RyanNeural (male, UK English)\n * - de-DE-KatjaNeural (female, German)\n * - fr-FR-DeniseNeural (female, French)\n * - es-ES-ElviraNeural (female, Spanish)\n * - ja-JP-NanamiNeural (female, Japanese)\n * - zh-CN-XiaoxiaoNeural (female, Chinese)\n */\nexport const edgeTTSPlugin: Plugin = {\n name: \"edge-tts\",\n description:\n \"Free text-to-speech synthesis using Microsoft Edge TTS - no API key required, high-quality neural voices\",\n models: {\n [ModelType.TEXT_TO_SPEECH]: async (\n runtime: IAgentRuntime,\n input: string | EdgeTTSParams\n ): Promise<Buffer | ArrayBuffer | Uint8Array> => {\n const params: EdgeTTSParams = typeof input === \"string\" ? { text: input } : input;\n const settings = getEdgeTTSSettings(runtime);\n\n logger.log(`[EdgeTTS] Using TEXT_TO_SPEECH with voice: ${settings.voice}`);\n\n if (!params.text || params.text.trim().length === 0) {\n throw new Error(\"TEXT_TO_SPEECH requires non-empty text\");\n }\n\n // Edge TTS has a practical limit around 5000 characters\n if (params.text.length > 5000) {\n throw new Error(\"TEXT_TO_SPEECH text exceeds 5000 character limit\");\n }\n\n try {\n const audioBuffer = await generateSpeech(settings, params);\n return audioBuffer;\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : String(error);\n logger.error(`EdgeTTS model error: ${msg}`);\n throw error instanceof Error ? error : new Error(msg);\n }\n },\n },\n tests: [\n {\n name: \"test edge tts\",\n tests: [\n {\n name: \"Edge TTS settings validation\",\n fn: async (runtime: IAgentRuntime) => {\n const settings = getEdgeTTSSettings(runtime);\n\n if (!settings.voice) {\n throw new Error(\"Missing voice configuration\");\n }\n\n if (!settings.lang) {\n throw new Error(\"Missing language configuration\");\n }\n\n if (!settings.outputFormat) {\n throw new Error(\"Missing output format configuration\");\n }\n\n logger.success(\"Edge TTS settings validated successfully\");\n },\n },\n {\n name: \"Edge TTS voice preset mapping\",\n fn: async (_runtime: IAgentRuntime) => {\n // Test that OpenAI-style voice names map correctly\n const testCases = [\n { input: \"alloy\", expected: \"en-US-GuyNeural\" },\n { input: \"nova\", expected: \"en-US-JennyNeural\" },\n { input: \"shimmer\", expected: \"en-US-AriaNeural\" },\n {\n input: \"en-US-MichelleNeural\",\n expected: \"en-US-MichelleNeural\",\n },\n ];\n\n for (const tc of testCases) {\n const result = resolveVoice(tc.input, DEFAULT_VOICE);\n if (result !== tc.expected) {\n throw new Error(\n `Voice preset mapping failed: ${tc.input} -> ${result}, expected ${tc.expected}`\n );\n }\n }\n\n logger.success(\"Voice preset mapping validated successfully\");\n },\n },\n {\n name: \"Edge TTS speed to rate conversion\",\n fn: async (_runtime: IAgentRuntime) => {\n const testCases = [\n { speed: 1.0, expected: undefined },\n { speed: 1.5, expected: \"+50%\" },\n { speed: 0.75, expected: \"-25%\" },\n { speed: 2.0, expected: \"+100%\" },\n ];\n\n for (const tc of testCases) {\n const result = speedToRate(tc.speed);\n if (result !== tc.expected) {\n throw new Error(\n `Speed conversion failed: ${tc.speed} -> ${result}, expected ${tc.expected}`\n );\n }\n }\n\n logger.success(\"Speed to rate conversion validated successfully\");\n },\n },\n {\n name: \"Edge TTS generation (live test)\",\n fn: async (runtime: IAgentRuntime) => {\n const testText = \"Hello, this is a test of Edge TTS.\";\n\n try {\n const audioBuffer = (await runtime.useModel(ModelType.TEXT_TO_SPEECH, testText)) as\n | Buffer\n | Uint8Array;\n\n if (!audioBuffer || audioBuffer.length === 0) {\n throw new Error(\"Received empty audio buffer\");\n }\n\n logger.success(`Edge TTS generation successful: ${audioBuffer.length} bytes`);\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : String(error);\n // Edge TTS might fail in CI environments without network\n if (msg.includes(\"ENOTFOUND\") || msg.includes(\"network\")) {\n logger.warn(`Edge TTS live test skipped (network unavailable): ${msg}`);\n return;\n }\n throw error;\n }\n },\n },\n ],\n },\n ],\n};\n\nexport default edgeTTSPlugin;\n\n// Re-export types\nexport type { EdgeTTSSettings, EdgeTTSParams };\n\n// Export helper functions for testing\nexport const _test = {\n resolveVoice,\n speedToRate,\n inferExtension,\n getEdgeTTSSettings,\n};\n"
6
- ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAkD,IAAlD;AACuB,IAAvB;AACiB,IAAjB;AACmE,IAAnE;AACwB,IAAxB;AAoCA,IAAM,gBAAgB;AACtB,IAAM,eAAe;AACrB,IAAM,wBAAwB;AAC9B,IAAM,qBAAqB;AAG3B,IAAM,gBAAwC;AAAA,EAE5C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAEX;AAEA,SAAS,UAAU,CAAC,SAAwB,KAAa,UAAuC;AAAA,EAC9F,MAAM,WACJ,OAAO,YAAY,eAAgB,QAA6C,MAC3E,QAA4C,IAAI,OACjD;AAAA,EACN,OAAQ,QAAQ,WAAW,GAAG,KAA4B,YAAY;AAAA;AAGxE,SAAS,kBAAkB,CAAC,SAAyC;AAAA,EACnE,MAAM,aAAa,WAAW,SAAS,qBAAqB;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO,WAAW,SAAS,kBAAkB,aAAa,KAAK;AAAA,IAC/D,MAAM,WAAW,SAAS,iBAAiB,YAAY,KAAK;AAAA,IAC5D,cACE,WAAW,SAAS,0BAA0B,qBAAqB,KAAK;AAAA,IAC1E,MAAM,WAAW,SAAS,eAAe;AAAA,IACzC,OAAO,WAAW,SAAS,gBAAgB;AAAA,IAC3C,QAAQ,WAAW,SAAS,iBAAiB;AAAA,IAC7C,OAAO,WAAW,SAAS,gBAAgB;AAAA,IAC3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* Browser entry point for @elizaos/plugin-edge-tts
3
- *
4
- * Edge TTS is not available in browser environments because it requires
5
- * Node.js file system access and WebSocket connections that browsers don't support.
6
- *
7
- * For browser TTS, use @elizaos/plugin-elevenlabs or @elizaos/plugin-openai instead.
8
- */
9
- import { type Plugin } from "@elizaos/core";
10
- export declare const edgeTTSPlugin: Plugin;
11
- export default edgeTTSPlugin;
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "@elizaos/core";
@@ -1,6 +0,0 @@
1
- /**
2
- * Node.js entry point for @elizaos/plugin-edge-tts
3
- * Edge TTS requires Node.js for file system access
4
- */
5
- export * from "./index";
6
- export { default } from "./index";
@@ -1,2 +0,0 @@
1
- export * from '../index';
2
- export { default } from '../index';
@@ -1,215 +0,0 @@
1
- // src/index.ts
2
- import { mkdtempSync, readFileSync, rmSync } from "node:fs";
3
- import { tmpdir } from "node:os";
4
- import path from "node:path";
5
- import { logger, ModelType } from "@elizaos/core";
6
- import { EdgeTTS } from "node-edge-tts";
7
- var DEFAULT_VOICE = "en-US-MichelleNeural";
8
- var DEFAULT_LANG = "en-US";
9
- var DEFAULT_OUTPUT_FORMAT = "audio-24khz-48kbitrate-mono-mp3";
10
- var DEFAULT_TIMEOUT_MS = 30000;
11
- var VOICE_PRESETS = {
12
- alloy: "en-US-GuyNeural",
13
- echo: "en-US-ChristopherNeural",
14
- fable: "en-GB-RyanNeural",
15
- onyx: "en-US-DavisNeural",
16
- nova: "en-US-JennyNeural",
17
- shimmer: "en-US-AriaNeural"
18
- };
19
- function getSetting(runtime, key, fallback) {
20
- const envValue = typeof process !== "undefined" && process.env ? process.env[key] : undefined;
21
- return runtime.getSetting(key) ?? envValue ?? fallback;
22
- }
23
- function getEdgeTTSSettings(runtime) {
24
- const timeoutStr = getSetting(runtime, "EDGE_TTS_TIMEOUT_MS");
25
- return {
26
- voice: getSetting(runtime, "EDGE_TTS_VOICE", DEFAULT_VOICE) ?? DEFAULT_VOICE,
27
- lang: getSetting(runtime, "EDGE_TTS_LANG", DEFAULT_LANG) ?? DEFAULT_LANG,
28
- outputFormat: getSetting(runtime, "EDGE_TTS_OUTPUT_FORMAT", DEFAULT_OUTPUT_FORMAT) ?? DEFAULT_OUTPUT_FORMAT,
29
- rate: getSetting(runtime, "EDGE_TTS_RATE"),
30
- pitch: getSetting(runtime, "EDGE_TTS_PITCH"),
31
- volume: getSetting(runtime, "EDGE_TTS_VOLUME"),
32
- proxy: getSetting(runtime, "EDGE_TTS_PROXY"),
33
- timeoutMs: timeoutStr ? Number.parseInt(timeoutStr, 10) : DEFAULT_TIMEOUT_MS
34
- };
35
- }
36
- function resolveVoice(voice, defaultVoice) {
37
- if (!voice)
38
- return defaultVoice;
39
- const preset = VOICE_PRESETS[voice.toLowerCase()];
40
- if (preset)
41
- return preset;
42
- return voice;
43
- }
44
- function speedToRate(speed) {
45
- if (speed === undefined || speed === 1)
46
- return;
47
- const percentage = Math.round((speed - 1) * 100);
48
- return percentage >= 0 ? `+${percentage}%` : `${percentage}%`;
49
- }
50
- function inferExtension(outputFormat) {
51
- const normalized = outputFormat.toLowerCase();
52
- if (normalized.includes("webm"))
53
- return ".webm";
54
- if (normalized.includes("ogg"))
55
- return ".ogg";
56
- if (normalized.includes("opus"))
57
- return ".opus";
58
- if (normalized.includes("wav") || normalized.includes("riff") || normalized.includes("pcm")) {
59
- return ".wav";
60
- }
61
- return ".mp3";
62
- }
63
- async function generateSpeech(settings, params) {
64
- const voice = resolveVoice(params.voice, settings.voice);
65
- const lang = params.lang ?? settings.lang;
66
- const outputFormat = params.outputFormat ?? settings.outputFormat;
67
- const rate = params.rate ?? speedToRate(params.speed) ?? settings.rate;
68
- const pitch = params.pitch ?? settings.pitch;
69
- const volume = params.volume ?? settings.volume;
70
- logger.debug(`[EdgeTTS] Generating speech with voice: ${voice}, lang: ${lang}`);
71
- const tts = new EdgeTTS({
72
- voice,
73
- lang,
74
- outputFormat,
75
- saveSubtitles: false,
76
- proxy: settings.proxy,
77
- rate,
78
- pitch,
79
- volume,
80
- timeout: settings.timeoutMs
81
- });
82
- const tempDir = mkdtempSync(path.join(tmpdir(), "edge-tts-"));
83
- const extension = inferExtension(outputFormat);
84
- const outputPath = path.join(tempDir, `speech${extension}`);
85
- try {
86
- await tts.ttsPromise(params.text, outputPath);
87
- const audioBuffer = readFileSync(outputPath);
88
- return audioBuffer;
89
- } finally {
90
- try {
91
- rmSync(tempDir, { recursive: true, force: true });
92
- } catch {}
93
- }
94
- }
95
- var edgeTTSPlugin = {
96
- name: "edge-tts",
97
- description: "Free text-to-speech synthesis using Microsoft Edge TTS - no API key required, high-quality neural voices",
98
- models: {
99
- [ModelType.TEXT_TO_SPEECH]: async (runtime, input) => {
100
- const params = typeof input === "string" ? { text: input } : input;
101
- const settings = getEdgeTTSSettings(runtime);
102
- logger.log(`[EdgeTTS] Using TEXT_TO_SPEECH with voice: ${settings.voice}`);
103
- if (!params.text || params.text.trim().length === 0) {
104
- throw new Error("TEXT_TO_SPEECH requires non-empty text");
105
- }
106
- if (params.text.length > 5000) {
107
- throw new Error("TEXT_TO_SPEECH text exceeds 5000 character limit");
108
- }
109
- try {
110
- const audioBuffer = await generateSpeech(settings, params);
111
- return audioBuffer;
112
- } catch (error) {
113
- const msg = error instanceof Error ? error.message : String(error);
114
- logger.error(`EdgeTTS model error: ${msg}`);
115
- throw error instanceof Error ? error : new Error(msg);
116
- }
117
- }
118
- },
119
- tests: [
120
- {
121
- name: "test edge tts",
122
- tests: [
123
- {
124
- name: "Edge TTS settings validation",
125
- fn: async (runtime) => {
126
- const settings = getEdgeTTSSettings(runtime);
127
- if (!settings.voice) {
128
- throw new Error("Missing voice configuration");
129
- }
130
- if (!settings.lang) {
131
- throw new Error("Missing language configuration");
132
- }
133
- if (!settings.outputFormat) {
134
- throw new Error("Missing output format configuration");
135
- }
136
- logger.success("Edge TTS settings validated successfully");
137
- }
138
- },
139
- {
140
- name: "Edge TTS voice preset mapping",
141
- fn: async (_runtime) => {
142
- const testCases = [
143
- { input: "alloy", expected: "en-US-GuyNeural" },
144
- { input: "nova", expected: "en-US-JennyNeural" },
145
- { input: "shimmer", expected: "en-US-AriaNeural" },
146
- {
147
- input: "en-US-MichelleNeural",
148
- expected: "en-US-MichelleNeural"
149
- }
150
- ];
151
- for (const tc of testCases) {
152
- const result = resolveVoice(tc.input, DEFAULT_VOICE);
153
- if (result !== tc.expected) {
154
- throw new Error(`Voice preset mapping failed: ${tc.input} -> ${result}, expected ${tc.expected}`);
155
- }
156
- }
157
- logger.success("Voice preset mapping validated successfully");
158
- }
159
- },
160
- {
161
- name: "Edge TTS speed to rate conversion",
162
- fn: async (_runtime) => {
163
- const testCases = [
164
- { speed: 1, expected: undefined },
165
- { speed: 1.5, expected: "+50%" },
166
- { speed: 0.75, expected: "-25%" },
167
- { speed: 2, expected: "+100%" }
168
- ];
169
- for (const tc of testCases) {
170
- const result = speedToRate(tc.speed);
171
- if (result !== tc.expected) {
172
- throw new Error(`Speed conversion failed: ${tc.speed} -> ${result}, expected ${tc.expected}`);
173
- }
174
- }
175
- logger.success("Speed to rate conversion validated successfully");
176
- }
177
- },
178
- {
179
- name: "Edge TTS generation (live test)",
180
- fn: async (runtime) => {
181
- const testText = "Hello, this is a test of Edge TTS.";
182
- try {
183
- const audioBuffer = await runtime.useModel(ModelType.TEXT_TO_SPEECH, testText);
184
- if (!audioBuffer || audioBuffer.length === 0) {
185
- throw new Error("Received empty audio buffer");
186
- }
187
- logger.success(`Edge TTS generation successful: ${audioBuffer.length} bytes`);
188
- } catch (error) {
189
- const msg = error instanceof Error ? error.message : String(error);
190
- if (msg.includes("ENOTFOUND") || msg.includes("network")) {
191
- logger.warn(`Edge TTS live test skipped (network unavailable): ${msg}`);
192
- return;
193
- }
194
- throw error;
195
- }
196
- }
197
- }
198
- ]
199
- }
200
- ]
201
- };
202
- var src_default = edgeTTSPlugin;
203
- var _test = {
204
- resolveVoice,
205
- speedToRate,
206
- inferExtension,
207
- getEdgeTTSSettings
208
- };
209
- export {
210
- edgeTTSPlugin,
211
- src_default as default,
212
- _test
213
- };
214
-
215
- //# debugId=72B923D58112D3ED64756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "sourcesContent": [
5
- "import { mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { type IAgentRuntime, logger, ModelType, type Plugin } from \"@elizaos/core\";\nimport { EdgeTTS } from \"node-edge-tts\";\n\n/**\n * Edge TTS voice settings configuration\n */\ninterface EdgeTTSSettings {\n voice: string;\n lang: string;\n outputFormat: string;\n rate?: string;\n pitch?: string;\n volume?: string;\n proxy?: string;\n timeoutMs: number;\n}\n\n/**\n * Extended TTS params with Edge-specific options\n */\ninterface EdgeTTSParams {\n text: string;\n voice?: string;\n speed?: number;\n /** Edge TTS specific: language code */\n lang?: string;\n /** Edge TTS specific: output format */\n outputFormat?: string;\n /** Edge TTS specific: rate adjustment (e.g., +10%, -5%) */\n rate?: string;\n /** Edge TTS specific: pitch adjustment (e.g., +5Hz, -10Hz) */\n pitch?: string;\n /** Edge TTS specific: volume adjustment (e.g., +20%, -10%) */\n volume?: string;\n}\n\n// Default voice configurations\nconst DEFAULT_VOICE = \"en-US-MichelleNeural\";\nconst DEFAULT_LANG = \"en-US\";\nconst DEFAULT_OUTPUT_FORMAT = \"audio-24khz-48kbitrate-mono-mp3\";\nconst DEFAULT_TIMEOUT_MS = 30000;\n\n// Voice presets mapping common voice names to Edge TTS voices\nconst VOICE_PRESETS: Record<string, string> = {\n // Generic voices (map to good defaults)\n alloy: \"en-US-GuyNeural\",\n echo: \"en-US-ChristopherNeural\",\n fable: \"en-GB-RyanNeural\",\n onyx: \"en-US-DavisNeural\",\n nova: \"en-US-JennyNeural\",\n shimmer: \"en-US-AriaNeural\",\n // Direct Edge TTS voice names pass through\n};\n\nfunction getSetting(runtime: IAgentRuntime, key: string, fallback?: string): string | undefined {\n const envValue =\n typeof process !== \"undefined\" && (process as { env?: Record<string, string> }).env\n ? (process as { env: Record<string, string> }).env[key]\n : undefined;\n return (runtime.getSetting(key) as string | undefined) ?? envValue ?? fallback;\n}\n\nfunction getEdgeTTSSettings(runtime: IAgentRuntime): EdgeTTSSettings {\n const timeoutStr = getSetting(runtime, \"EDGE_TTS_TIMEOUT_MS\");\n return {\n voice: getSetting(runtime, \"EDGE_TTS_VOICE\", DEFAULT_VOICE) ?? DEFAULT_VOICE,\n lang: getSetting(runtime, \"EDGE_TTS_LANG\", DEFAULT_LANG) ?? DEFAULT_LANG,\n outputFormat:\n getSetting(runtime, \"EDGE_TTS_OUTPUT_FORMAT\", DEFAULT_OUTPUT_FORMAT) ?? DEFAULT_OUTPUT_FORMAT,\n rate: getSetting(runtime, \"EDGE_TTS_RATE\"),\n pitch: getSetting(runtime, \"EDGE_TTS_PITCH\"),\n volume: getSetting(runtime, \"EDGE_TTS_VOLUME\"),\n proxy: getSetting(runtime, \"EDGE_TTS_PROXY\"),\n timeoutMs: timeoutStr ? Number.parseInt(timeoutStr, 10) : DEFAULT_TIMEOUT_MS,\n };\n}\n\n/**\n * Resolve voice name - handles OpenAI-style voice names and Edge TTS voice IDs\n */\nfunction resolveVoice(voice: string | undefined, defaultVoice: string): string {\n if (!voice) return defaultVoice;\n\n // Check if it's a preset name\n const preset = VOICE_PRESETS[voice.toLowerCase()];\n if (preset) return preset;\n\n // Assume it's a direct Edge TTS voice ID\n return voice;\n}\n\n/**\n * Convert speed multiplier to Edge TTS rate string\n * speed: 1.0 = normal, 0.5 = half speed, 2.0 = double speed\n */\nfunction speedToRate(speed: number | undefined): string | undefined {\n if (speed === undefined || speed === 1.0) return undefined;\n const percentage = Math.round((speed - 1) * 100);\n return percentage >= 0 ? `+${percentage}%` : `${percentage}%`;\n}\n\n/**\n * Infer file extension from Edge TTS output format\n */\nfunction inferExtension(outputFormat: string): string {\n const normalized = outputFormat.toLowerCase();\n if (normalized.includes(\"webm\")) return \".webm\";\n if (normalized.includes(\"ogg\")) return \".ogg\";\n if (normalized.includes(\"opus\")) return \".opus\";\n if (normalized.includes(\"wav\") || normalized.includes(\"riff\") || normalized.includes(\"pcm\")) {\n return \".wav\";\n }\n return \".mp3\";\n}\n\n/**\n * Generate speech using Microsoft Edge TTS\n */\nasync function generateSpeech(settings: EdgeTTSSettings, params: EdgeTTSParams): Promise<Buffer> {\n const voice = resolveVoice(params.voice, settings.voice);\n const lang = params.lang ?? settings.lang;\n const outputFormat = params.outputFormat ?? settings.outputFormat;\n const rate = params.rate ?? speedToRate(params.speed) ?? settings.rate;\n const pitch = params.pitch ?? settings.pitch;\n const volume = params.volume ?? settings.volume;\n\n logger.debug(`[EdgeTTS] Generating speech with voice: ${voice}, lang: ${lang}`);\n\n const tts = new EdgeTTS({\n voice,\n lang,\n outputFormat,\n saveSubtitles: false,\n proxy: settings.proxy,\n rate,\n pitch,\n volume,\n timeout: settings.timeoutMs,\n });\n\n // Create temp directory for output\n const tempDir = mkdtempSync(path.join(tmpdir(), \"edge-tts-\"));\n const extension = inferExtension(outputFormat);\n const outputPath = path.join(tempDir, `speech${extension}`);\n\n try {\n await tts.ttsPromise(params.text, outputPath);\n const audioBuffer = readFileSync(outputPath);\n return audioBuffer;\n } finally {\n // Cleanup temp directory\n try {\n rmSync(tempDir, { recursive: true, force: true });\n } catch {\n // Ignore cleanup errors\n }\n }\n}\n\n/**\n * Edge TTS Plugin for ElizaOS\n *\n * Provides free text-to-speech synthesis using Microsoft Edge's TTS service.\n * No API key required - uses the same TTS engine as Microsoft Edge browser.\n *\n * Features:\n * - High-quality neural voices\n * - Multiple languages and locales\n * - Adjustable rate, pitch, and volume\n * - No API key or payment required\n *\n * Optional environment variables:\n * - EDGE_TTS_VOICE: Voice ID (default: en-US-MichelleNeural)\n * - EDGE_TTS_LANG: Language code (default: en-US)\n * - EDGE_TTS_OUTPUT_FORMAT: Output format (default: audio-24khz-48kbitrate-mono-mp3)\n * - EDGE_TTS_RATE: Speech rate adjustment (e.g., +10%, -5%)\n * - EDGE_TTS_PITCH: Pitch adjustment (e.g., +5Hz, -10Hz)\n * - EDGE_TTS_VOLUME: Volume adjustment (e.g., +20%, -10%)\n * - EDGE_TTS_PROXY: HTTP proxy URL\n * - EDGE_TTS_TIMEOUT_MS: Request timeout (default: 30000)\n *\n * Popular voices:\n * - en-US-MichelleNeural (female, US English)\n * - en-US-GuyNeural (male, US English)\n * - en-US-JennyNeural (female, US English)\n * - en-US-AriaNeural (female, US English)\n * - en-GB-SoniaNeural (female, UK English)\n * - en-GB-RyanNeural (male, UK English)\n * - de-DE-KatjaNeural (female, German)\n * - fr-FR-DeniseNeural (female, French)\n * - es-ES-ElviraNeural (female, Spanish)\n * - ja-JP-NanamiNeural (female, Japanese)\n * - zh-CN-XiaoxiaoNeural (female, Chinese)\n */\nexport const edgeTTSPlugin: Plugin = {\n name: \"edge-tts\",\n description:\n \"Free text-to-speech synthesis using Microsoft Edge TTS - no API key required, high-quality neural voices\",\n models: {\n [ModelType.TEXT_TO_SPEECH]: async (\n runtime: IAgentRuntime,\n input: string | EdgeTTSParams\n ): Promise<Buffer | ArrayBuffer | Uint8Array> => {\n const params: EdgeTTSParams = typeof input === \"string\" ? { text: input } : input;\n const settings = getEdgeTTSSettings(runtime);\n\n logger.log(`[EdgeTTS] Using TEXT_TO_SPEECH with voice: ${settings.voice}`);\n\n if (!params.text || params.text.trim().length === 0) {\n throw new Error(\"TEXT_TO_SPEECH requires non-empty text\");\n }\n\n // Edge TTS has a practical limit around 5000 characters\n if (params.text.length > 5000) {\n throw new Error(\"TEXT_TO_SPEECH text exceeds 5000 character limit\");\n }\n\n try {\n const audioBuffer = await generateSpeech(settings, params);\n return audioBuffer;\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : String(error);\n logger.error(`EdgeTTS model error: ${msg}`);\n throw error instanceof Error ? error : new Error(msg);\n }\n },\n },\n tests: [\n {\n name: \"test edge tts\",\n tests: [\n {\n name: \"Edge TTS settings validation\",\n fn: async (runtime: IAgentRuntime) => {\n const settings = getEdgeTTSSettings(runtime);\n\n if (!settings.voice) {\n throw new Error(\"Missing voice configuration\");\n }\n\n if (!settings.lang) {\n throw new Error(\"Missing language configuration\");\n }\n\n if (!settings.outputFormat) {\n throw new Error(\"Missing output format configuration\");\n }\n\n logger.success(\"Edge TTS settings validated successfully\");\n },\n },\n {\n name: \"Edge TTS voice preset mapping\",\n fn: async (_runtime: IAgentRuntime) => {\n // Test that OpenAI-style voice names map correctly\n const testCases = [\n { input: \"alloy\", expected: \"en-US-GuyNeural\" },\n { input: \"nova\", expected: \"en-US-JennyNeural\" },\n { input: \"shimmer\", expected: \"en-US-AriaNeural\" },\n {\n input: \"en-US-MichelleNeural\",\n expected: \"en-US-MichelleNeural\",\n },\n ];\n\n for (const tc of testCases) {\n const result = resolveVoice(tc.input, DEFAULT_VOICE);\n if (result !== tc.expected) {\n throw new Error(\n `Voice preset mapping failed: ${tc.input} -> ${result}, expected ${tc.expected}`\n );\n }\n }\n\n logger.success(\"Voice preset mapping validated successfully\");\n },\n },\n {\n name: \"Edge TTS speed to rate conversion\",\n fn: async (_runtime: IAgentRuntime) => {\n const testCases = [\n { speed: 1.0, expected: undefined },\n { speed: 1.5, expected: \"+50%\" },\n { speed: 0.75, expected: \"-25%\" },\n { speed: 2.0, expected: \"+100%\" },\n ];\n\n for (const tc of testCases) {\n const result = speedToRate(tc.speed);\n if (result !== tc.expected) {\n throw new Error(\n `Speed conversion failed: ${tc.speed} -> ${result}, expected ${tc.expected}`\n );\n }\n }\n\n logger.success(\"Speed to rate conversion validated successfully\");\n },\n },\n {\n name: \"Edge TTS generation (live test)\",\n fn: async (runtime: IAgentRuntime) => {\n const testText = \"Hello, this is a test of Edge TTS.\";\n\n try {\n const audioBuffer = (await runtime.useModel(ModelType.TEXT_TO_SPEECH, testText)) as\n | Buffer\n | Uint8Array;\n\n if (!audioBuffer || audioBuffer.length === 0) {\n throw new Error(\"Received empty audio buffer\");\n }\n\n logger.success(`Edge TTS generation successful: ${audioBuffer.length} bytes`);\n } catch (error: unknown) {\n const msg = error instanceof Error ? error.message : String(error);\n // Edge TTS might fail in CI environments without network\n if (msg.includes(\"ENOTFOUND\") || msg.includes(\"network\")) {\n logger.warn(`Edge TTS live test skipped (network unavailable): ${msg}`);\n return;\n }\n throw error;\n }\n },\n },\n ],\n },\n ],\n};\n\nexport default edgeTTSPlugin;\n\n// Re-export types\nexport type { EdgeTTSSettings, EdgeTTSParams };\n\n// Export helper functions for testing\nexport const _test = {\n resolveVoice,\n speedToRate,\n inferExtension,\n getEdgeTTSSettings,\n};\n"
6
- ],
7
- "mappings": ";AAAA;AACA;AACA;AACA;AACA;AAoCA,IAAM,gBAAgB;AACtB,IAAM,eAAe;AACrB,IAAM,wBAAwB;AAC9B,IAAM,qBAAqB;AAG3B,IAAM,gBAAwC;AAAA,EAE5C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAEX;AAEA,SAAS,UAAU,CAAC,SAAwB,KAAa,UAAuC;AAAA,EAC9F,MAAM,WACJ,OAAO,YAAY,eAAgB,QAA6C,MAC3E,QAA4C,IAAI,OACjD;AAAA,EACN,OAAQ,QAAQ,WAAW,GAAG,KAA4B,YAAY;AAAA;AAGxE,SAAS,kBAAkB,CAAC,SAAyC;AAAA,EACnE,MAAM,aAAa,WAAW,SAAS,qBAAqB;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO,WAAW,SAAS,kBAAkB,aAAa,KAAK;AAAA,IAC/D,MAAM,WAAW,SAAS,iBAAiB,YAAY,KAAK;AAAA,IAC5D,cACE,WAAW,SAAS,0BAA0B,qBAAqB,KAAK;AAAA,IAC1E,MAAM,WAAW,SAAS,eAAe;AAAA,IACzC,OAAO,WAAW,SAAS,gBAAgB;AAAA,IAC3C,QAAQ,WAAW,SAAS,iBAAiB;AAAA,IAC7C,OAAO,WAAW,SAAS,gBAAgB;AAAA,IAC3C,WAAW,aAAa,OAA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