Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devidw/e11
fully typed js/ts openapi client for elevenlabs api
https://github.com/devidw/e11
elevenlabs elevenlabs-api elevenlabs-js elevenlabs-node
Last synced: 28 days ago
JSON representation
fully typed js/ts openapi client for elevenlabs api
- Host: GitHub
- URL: https://github.com/devidw/e11
- Owner: devidw
- Created: 2023-09-23T20:36:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-11T02:06:27.000Z (10 months ago)
- Last Synced: 2024-10-08T06:07:01.696Z (about 1 month ago)
- Topics: elevenlabs, elevenlabs-api, elevenlabs-js, elevenlabs-node
- Language: TypeScript
- Homepage: https://npmjs.com/package/e11
- Size: 46.9 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elf ~ e11
fully typed js/ts openapi client for elevenlabs api
- https://api.elevenlabs.io/docs
```bash
pnpm add e11
``````ts
import { Configuration, TextToSpeechApi } from "e11"
import fs from "fs"console.assert(process.env.SOME_SECRET)
const apiConfig = new Configuration({
apiKey: process.env.SOME_SECRET,
})const tts = new TextToSpeechApi(apiConfig)
const res = await tts.textToSpeechV1TextToSpeechVoiceIdPost(
{
voiceId: "21m00Tcm4TlvDq8ikWAM",
bodyTextToSpeechV1TextToSpeechVoiceIdPost: {
text: "helllo babeee",
modelId: "eleven_multilingual_v2",
},
},
{
responseType: "arraybuffer",
}
)console.log(res.statusText)
fs.writeFileSync("output.mp3", Buffer.from(res.data))
```