Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 435 Bytes

useSpeech.md

File metadata and controls

23 lines (15 loc) · 435 Bytes

useSpeech

Vue UI hook that synthesizes human voice that speaks a given string.

Usage

import {useSpeech} from 'vue-next-use';

const Demo = {
    setup(props) {

        const voices = window.speechSynthesis.getVoices();

        const state = useSpeech('Hello world!', {rate: 0.8, pitch: 0.5, voice: voices[0]});

        return () => (
            <pre>{JSON.stringify(state, null, 2)}</pre>
        );
    }
};