Models

Text-to-speech

wfloat/wfloat-tts

Model ID
wfloat/wfloat-tts
Type
Text-to-speech

Use this model

Use in a web app

Install the browser SDK:

npm install @wfloat/wfloat-web

Load the model and synthesize an utterance. The first load downloads the model and browser runtime; later loads use the browser cache.

import { loadTtsModel } from "@wfloat/wfloat-web";
const tts = await loadTtsModel("wfloat/wfloat-tts", {
onProgress(event) {
console.log(event.status, event.progress ?? "");
},
});
const result = await tts.synthesize({
text: "The signal is clean. Start the recording.",
voice: "narrator_woman",
emotion: "neutral",
intensity: 0.5,
speed: 1,
silencePaddingSec: 0.1,
});
console.log(result.audio.sampleRate);
console.log(result.timeline.chunks);

Inference and playback run on the user’s device. Use tts.pause(), tts.play(), and tts.stop() to control the active request.