We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Text-to-speech
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.
Install the React Native SDK:
npm install @wfloat/react-native-wfloat
Run pod install from the app’s ios directory after installing. Android is connected through React Native autolinking.
import { loadTtsModel } from '@wfloat/react-native-wfloat';
const tts = await loadTtsModel('wfloat/wfloat-tts', {
onProgress(event) {
console.log(event.status, event.progress ?? '');
},
});
const result = await tts.synthesize({
text: 'All systems are stable. Begin the launch sequence.',
voice: 'narrator_woman',
emotion: 'neutral',
intensity: 0.5,
speed: 1,
silencePaddingSec: 0.1,
});
console.log(result.audio.sampleRate, result.audio.durationSec);
console.log(result.timeline.chunks);
The model runs locally on iOS and Android. Use tts.pause(), tts.play(), and tts.stop() to control the active request.
Install the Python SDK:
pip install wfloat
Load the model, synthesize speech, and save the result as a WAV file:
import wfloat
tts = wfloat.load_tts_model("wfloat/wfloat-tts")
result = tts.synthesize(
text="No, that is not possible.",
voice="mad_scientist_woman",
emotion="surprise",
intensity=0.7,
speed=1.0,
silence_padding_sec=0.1,
)
result.audio.save("speech.wav")
print(result.model_id)
print(result.timeline.chunks[0].text)
The first load downloads the required assets. Subsequent loads use the local model cache.