Text-to-speech

hexgrad/Kokoro-82M

Use this model

Install

npm install @wfloat/wfloat-web

Text to speech

Japanese voices are not supported in this release.

import { loadTextToSpeech } from '@wfloat/wfloat-web';
const model = await loadTextToSpeech('hexgrad/Kokoro-82M');
const generation = model.generate('Hello, how are you?');
const result = await generation.result();
console.log(result.audio.samples, result.audio.sampleRate);
generation.dispose();
await model.unload();

Text to speech reference · Downloads and cleanup