/klea-js

KLEA in JavaScript

Primary LanguageJavaScript

Get Started

Download the model checkpoint and G2P model on Hugging Face and place them in the current directory.

import { tts } from "./model.js";
import fs from "node:fs/promises";

const wavBuffer = await tts("ស្រុកខ្មែរ");
await fs.writeFile("audio.wav", wavBuffer);

audio.wav

Test

npm i
npm start ស្រុកខ្មែរ test.wav

Serving

Running a web service to serve text-to-speech request

npm run serve

Visit: http://localhost:3000/កិច្ចការ

Container

docker build -t klea .
# run webservice
docker run --rm -it -p 3000:3000 klea

Visit: http://localhost:3000/កិច្ចការ