Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,87 @@
|
|
|
|
|
|
|
|
| 1 |
import { generateSpeech } from '@speech-sdk/core';
|
| 2 |
|
| 3 |
const result = await generateSpeech({
|
| 4 |
-
model: '
|
| 5 |
-
text: 'Hello from
|
| 6 |
-
voice: '
|
| 7 |
});
|
| 8 |
|
| 9 |
result.audio.uint8Array; // Uint8Array
|
| 10 |
result.audio.base64; // string (lazy)
|
| 11 |
-
result.audio.mediaType; // "audio/mpeg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
npm install @speech-sdk/core
|
| 2 |
+
|
| 3 |
import { generateSpeech } from '@speech-sdk/core';
|
| 4 |
|
| 5 |
const result = await generateSpeech({
|
| 6 |
+
model: 'elevenlabs/eleven_v3',
|
| 7 |
+
text: 'Hello from SpeechSDK!',
|
| 8 |
+
voice: 'EXAVITQu4vr4xnSDxMaL',
|
| 9 |
});
|
| 10 |
|
| 11 |
result.audio.uint8Array; // Uint8Array
|
| 12 |
result.audio.base64; // string (lazy)
|
| 13 |
+
result.audio.mediaType; // "audio/mpeg"
|
| 14 |
+
|
| 15 |
+
"name": "@speech-sdk/core",
|
| 16 |
+
"version": "0.9.0",
|
| 17 |
+
"description": "Universal, cross-platform text-to-speech SDK with multi-provider support.",
|
| 18 |
+
"type": "module",
|
| 19 |
+
"packageManager": "pnpm@10.11.1",
|
| 20 |
+
"main": "./dist/index.js",
|
| 21 |
+
"types": "./dist/index.d.ts",
|
| 22 |
+
"exports": {
|
| 23 |
+
".": {
|
| 24 |
+
"types": "./dist/index.d.ts",
|
| 25 |
+
"default": "./dist/index.js"
|
| 26 |
+
},
|
| 27 |
+
"./providers": {
|
| 28 |
+
"types": "./dist/providers.d.ts",
|
| 29 |
+
"default": "./dist/providers.js"
|
| 30 |
+
},
|
| 31 |
+
"./types": {
|
| 32 |
+
"types": "./dist/types.d.ts",
|
| 33 |
+
"default": "./dist/types.js"
|
| 34 |
+
},
|
| 35 |
+
"./pronunciations": {
|
| 36 |
+
"types": "./dist/pronunciations/index.d.ts",
|
| 37 |
+
"default": "./dist/pronunciations/index.js"
|
| 38 |
+
},
|
| 39 |
+
"./plugins": {
|
| 40 |
+
"types": "./dist/plugins/index.d.ts",
|
| 41 |
+
"default": "./dist/plugins/index.js"
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"files": [
|
| 45 |
+
"dist",
|
| 46 |
+
"README.md"
|
| 47 |
+
],
|
| 48 |
+
"sideEffects": false,
|
| 49 |
+
"scripts": {
|
| 50 |
+
"build": "tsc",
|
| 51 |
+
"test": "vitest run",
|
| 52 |
+
"test:watch": "vitest",
|
| 53 |
+
"test:e2e": "vitest run --config vitest.config.e2e.ts",
|
| 54 |
+
"typecheck": "tsc --noEmit",
|
| 55 |
+
"check": "ultracite check",
|
| 56 |
+
"fix": "ultracite fix"
|
| 57 |
+
},
|
| 58 |
+
"keywords": [
|
| 59 |
+
"tts",
|
| 60 |
+
"text-to-speech",
|
| 61 |
+
"speech",
|
| 62 |
+
"openai",
|
| 63 |
+
"elevenlabs",
|
| 64 |
+
"inworld",
|
| 65 |
+
"ai"
|
| 66 |
+
],
|
| 67 |
+
"license": "Apache-2.0",
|
| 68 |
+
"repository":SPEECH_GATEWAY_API_KEY {
|
| 69 |
+
"type": "git",
|
| 70 |
+
"url": "https://github.com/Jellypod-Inc/speech-sdk"
|
| 71 |
+
},
|
| 72 |
+
"dependencies": {
|
| 73 |
+
"@mediabunny/mp3-encoder": "^1.42.0",
|
| 74 |
+
"mediabunny": "^1.40.1",
|
| 75 |
+
"p-retry": "^8.0.0",
|
| 76 |
+
"zod": "^4.3.6"
|
| 77 |
+
},
|
| 78 |
+
"devDependencies": {
|
| 79 |
+
"@biomejs/biome": "2.4.14",
|
| 80 |
+
"@types/node": "^25.5.0",
|
| 81 |
+
"dotenv": "^17.3.1",
|
| 82 |
+
"typescript": "^5.8.0",
|
| 83 |
+
"ultracite": "7.6.2",
|
| 84 |
+
"vite": "^7.3.2",
|
| 85 |
+
"vitest": "^4.1.3"
|
| 86 |
+
}
|
| 87 |
+
}
|