JavaScript/TypeScript SDK to interact with the charactr API.
VC - Voice conversion - converting one voice from audio input to another voice.
TTS - Text to speech - converting text to voice audio.
>= v18.0.0
- making TTS requests
- making VC requests
- getting lists of available voices
$ yarn add @charactr/api-sdk
For the detailed SDK usage, please refer to the SDK reference or the ./examples
directory.
The ClientKey and ApiKey required to authenticate the SDK are meant to be private.
Packaging them with the frontend application effectively leaks them publicly and allows anyone to use your Charactr Account directly.
We strongly advise to proxy those requests via your own backend or use the browser SDK only for internal usage.
- Clone & install SDK locally
$ git clone https://github.com/charactr-platform/charactr-api-sdk-ts
$ yarn install
$ yarn build
$ npm install -g ts-node
- Open
./examples/credentials.ts
and paste your ClientKey and APIKey inside.
$ ts-node ./examples/nodejs/tts.ts
$ ts-node ./examples/nodejs/tts_stream_simplex.ts
$ ts-node ./examples/nodejs/tts_stream_duplex.ts
$ ts-node ./examples/nodejs/vc.ts
Navigate go ./examples/browser/
and open index.html
example in your browser of choice. Provided sample uses ESModules.