File size: 576 Bytes
3d50167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(function () {
    if (!window.KimiAPI) return;
    window.KimiAPI.registerVoice({
        id: "sample-voice",
        name: "Sample Voice",
        lang: "en-US",
        speak: function (text, options) {
            const utter = new SpeechSynthesisUtterance(text);
            utter.voice = speechSynthesis.getVoices().find(v => v.lang === "en-US");
            utter.rate = options?.rate || 1;
            utter.pitch = options?.pitch || 1;
            utter.volume = options?.volume || 1;
            speechSynthesis.speak(utter);
        }
    });
})();