js使用浏览器的speechSynthesis实现文字转语音效果代码

代码语言:html

所属分类:其他

代码描述:js使用浏览器的speechSynthesis实现文字转语音效果代码

代码标签: js 浏览器 speechSynthesis 文字 语音

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.3.3.4.css">

<style>
    body{
        padding:30px;
    }
</style>
</head>

<body>
    <form id="demoB" >
        <!-- (A) VOICE PICKER -->
        <div class="form-group login-group_re">
            <label>选择声音</label>
            <select id="demoB-voice" disabled></select>
        </div>
        <div class="form-group login-group_re">
            <!-- (A) VOLUME + PITCH + RATE -->
            <label>Volume</label>
            <input type="range" id="demoC-vol" min="0" max="1" step="0.1" value="1">

        </div>

        <div class="form-group login-group_re">
            <label>Pitch</label>
            <input type="range" id="demoC-pitch" min="0" max="2" step="0.1" value="1">

        </div>

        <div class="form-group login-group_re">
            <label>Rate</label>
            <input type="range" id="demoC-rate" min="0.1" max="10" step="0.1" value="1">

        </div>


        <div class="form-group login-group_re">
            <label>文字</label>
            <input type="text" id="demoB-msg" value="君不见黄河之水天上来" disabled required>
     .........完整代码请登录后点击上方下载按钮下载查看

网友评论0