Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/xspace-agent/agent-voice-chat/tests/e2e/providers/elevenlabs-tts.e2e.test.js

overstepping95aba1af2b51
diff --git a/xspace-agent/xspace-agent/agent-voice-chat/tests/e2e/providers/elevenlabs-tts.e2e.test.js b/xspace-agent/xspace-agent/agent-voice-chat/tests/e2e/providers/elevenlabs-tts.e2e.test.js
new file mode 100644
index 000000000..8014461d2
--- /dev/null
+++ b/xspace-agent/xspace-agent/agent-voice-chat/tests/e2e/providers/elevenlabs-tts.e2e.test.js
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent)
+
+import { describe, it, expect } from "vitest"
+import { describeProvider, measureLatency } from "../setup.js"
+
+describeProvider("elevenlabs", () => {
+ it("should synthesize speech with ElevenLabs", async () => {
+ const axios = (await import("axios")).default
+
+ const voiceId = process.env.ELEVENLABS_VOICE_0 || "VR6AewLTigWG4xSOukaG"
+
+ const { result: audioBuffer, latencyMs } = await measureLatency(async () => {
+ const response = await axios.post(
+ `https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`,
+ {
+ text: "Hello, this is an end-to-end test.",
+ model_id: "eleven_multilingual_v2",
+ voice_settings: { stability: 0.5, similarity_boost: 0.8, style: 0.0, use_speaker_boost: true },
+ },
+ {
+ headers: {
+ "xi-api-key": process.env.ELEVENLABS_API_KEY,
+ "Content-Type": "application/json",
+ Accept: "audio/mpeg",
+ },
+ responseType: "arraybuffer",
+ }
+ )
+ return Buffer.from(response.data)
+ })
+
+ expect(audioBuffer).toBeInstanceOf(Buffer)
+ expect(audioBuffer.length).toBeGreaterThan(100)
+ expect(latencyMs).toBeLessThan(30000)
+
+ console.log(`[E2E] ElevenLabs TTS: ${audioBuffer.length} bytes (${latencyMs}ms)`)
+ })
+})
+
+