Text 如何在Windows中更改SAPI语音[PHP]
我的基本代码如下:Text 如何在Windows中更改SAPI语音[PHP],text,speech,Text,Speech,我的基本代码如下: $voice = new COM("SAPI.SpVoice"); voice .Speak("hello world"); 我正在摆脱默认的声音,所以 我现在正在寻找一种改变TTS使用哪种声音的方法。 我想把SAPI的声音改成ZIRA 更改默认语音的正确方法是什么,我在这里读了一些线程,但它是用javascript编写的,不起作用 我的代码: @$submit = $_POST['process']; @$word = $_POST['texttospeech'];
$voice = new COM("SAPI.SpVoice");
voice .Speak("hello world");
我正在摆脱默认的声音,所以
我现在正在寻找一种改变TTS使用哪种声音的方法。
我想把SAPI的声音改成ZIRA
更改默认语音的正确方法是什么,我在这里读了一些线程,但它是用javascript编写的,不起作用
我的代码:
@$submit = $_POST['process'];
@$word = $_POST['texttospeech'];
$voice = new COM("SAPI.SpVoice");
if($_SERVER["REQUEST_METHOD"] == "POST" and isset($submit) and !empty($word)){
$voice->Speak($word);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<title>PHP Text to Speech</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="img/fav.png" type="image/png">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body onload="startTime()">
<nav class="navbar-inverse" role="navigation">
<a href="https://google.com/" target="_blank">
<img src="img/cod.png" class="hederimg">
</a>
<div id="clockdate">
<div class="clockdate-wrapper">
<div id="clock"></div>
<div id="date"><?php echo date('l, F j, Y'); ?></div>
</div>
</div>
</nav>
<div class="topmost">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">
<center>
<strong class="panelinputtitle">PHP Text to Speech Converter Using Microsoft Speech API</strong>
</center>
</div>
<div class="panel-body">
<form method = "POST">
<div class = "form-group">
<textarea class="form-control input-sm" rows="6" name="texttospeech" placeholder="Type your Text Here..."></textarea>
</div>
<div class = "form-group">
<input type = "submit" class = "btn btn-primary btn-block" name="process" value="Speak">
</div>
</form>
</div>
</div>
</div>
</div>
<script src="js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>
@$submit=$_POST['process'];
@$word=$\u POST['texttospeech'];
$voice=新COM(“SAPI.SpVoice”);
if($\服务器[“请求\方法”]==“发布”和isset($submit)和!空($word)){
$voice->Speak($word);
}
?>
PHP文本到语音
使用Microsoft语音API的PHP文本到语音转换器
提前谢谢。我已经找了很久了。。 至少在控制面板中选择Zira作为默认语音起作用
我已经找了很久了。。 至少在控制面板中选择Zira作为默认语音起作用