How to Change SAPI VOICES in Windows [PHP] - text

I have basic code which works as:
$voice = new COM("SAPI.SpVoice");
voice .Speak("hello world");
I am getting RID of default voice, So
I am now looking at a way to change which voice is getting used for the TTS.
I want to change SAPI voice to ZIRA
What is the correct way to change the default voice, I read some thread here , But it is in javascript, and it is not working.
my code :
#$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>
Thanks in advance.

I've searched this one a long time ..
At least selecting Zira within the control panel as default voice works

Related

write jpg php Arabic?

I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
<?php
include('ar-php/src/Arabic.php');
if(isset($_POST['sub']))
{
$font = 'Almarai/Almarai-Bold.ttf';
$font1= "Almarai/Almarai-Light.ttf";
$im =imagecreatefromjpeg("certificate-1.jpg");
$name= $_POST['name'];
$output =$name.".jpg";
$msg="This Certificate is Auto Generated:". date("d/m/Y");
$textColor = imagecolorallocate ($im,0,0,0);
$Arabic = new Arabic('ArGlyphs');
$text = '$name';
$text = $Arabic->utf8Glyphs($text);
// الصورة وحجمها وموقع الخط ونوع الخط ولونه والكتابة
imagettftext($im,80, 0, 2000, 2000,$textColor, $font, ucwords($name));
imagettftext($im, 30, 0, 10, 2400,$textColor, $font1, $msg);
imagejpeg($im,$output);
header('Content-Description: File Transfer');
header('Content-Type: application/image');
header('Content-Disposition: attachment; filename="'.basename($output).'"');
header('Content-Length: ' . filesize($output));
readfile($output);
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<title>
موقع شهادات
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, inital-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="card" style="margin-top:20%">
<div class="card-header bg-success">
<h3 class="text-center text-white">
موقع شهادات تجريبي
</h3>
</div>
<div class="card-body">
<form id="form" method="post" enctype="multipart/form-data">
<div class="form-group">
<label>الاسم:</label>
<input type="text" name="name" autocomplete="off" class="form-control">
</div>
<div class="form-group">
<input type="submit" value="اطبع" name="sub" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
I tried to install the Arabic library, but the following error appears:
Warning: Undefined variable $Arabic in C:\xampp\htdocs\Certificate-Print\index.php on line 16
Fatal error: Uncaught Error: Call to a member function utf8Glyphs() on null in C:\xampp\htdocs\Certificate-Print\index.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Certificate-Print\index.php on line 16
I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
I want to write on the picture in Arabic fonts
This is the code that I did, but I could not install the Arabic library correctly
You are getting the error because $Arabic is null. I suspect that class name is not called Arabic ?
When I read the docs the class is called I18N_Arabic. So your line should be
$Arabic = new I18N_Arabic ('ArGlyphs');
You have too many things called Arabic for my liking - its a recipe for disaster.

Nested columns always stack?

I am trying to use bootstrap 5.1 to achieve a responsive layout, but don't get the expected outcome.
I have two columns I want to be adjacent in large screens and stacked in small screens. The first column is further subdivided by two (nested) columns; one with the title and one with three buttons. I would like these to stack in large screens (i.e. buttons below title) and position adjacent in small screens (i.e. buttons next to title).
Instead, the nested columns always stack. What am I doing wrong?
fiddle: fiddle
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>TITLE</title>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="hidden-sm col-md-1 col-lg-2"></div>
<div class="col-sm-12 col-md-10 col-lg-8">
<div class="row">
<div class="col-xs-12 col-sm-5">
<div class="row">
<div class="col-xs-6 col-sm-12">
<h4>TITLE</h4>
</div>
<div class="col-xs-6 col-sm-12">
<button type="button" class="btn active btn-danger btn-block">1</button>
<button type="button" class="btn active btn-success btn-block">2</button>
<button type="button" class="btn active btn-danger btn-block">3</button>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-7">
<div id="clock" style="background-color:black; height:5rem;">&nbsp &nbsp</div>
</div>
<div class="hidden-sm col-md-1"></div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>

i can't figure how to turn an html page to an xhtml(jsf) , when i run the page i get no tag was defined for name: input

im trying to implement jsf for a login page , when i run it it give me this :[/login.xhtml #33,49 <h:input> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: input] avec la cause
javax.faces.view.facelets.TagException: /login.xhtml #33,49 <h:input> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: input
login.xhtml =
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<meta charset="utf-8" />
<title>Web Application | todo</title>
<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="Web Application _ todo_files/app.v2.css" type="text/css"/>
<link rel="stylesheet" href="Web Application _ todo_files/font.css" type="text/css"/>
<!--[if lt IE 9]> <script src="js/ie/respond.min.js" cache="false"></script> <script src="js/ie/html5.js" cache="false"></script> <script src="js/ie/fix.js" cache="false"></script> <![endif]-->
</h:head>
<body>
<section id="content" class="m-t-lg wrapper-md animated fadeInUp">
<a class="nav-brand" href="index.html">WELCOME</a>
<div class="row m-n">
<div class="col-md-4 col-md-offset-4 m-t-lg">
<section class="panel">
<header class="panel-heading text-center"> Sign in </header>
<h:form action="index.html" class="panel-body">
<div class="form-group"> <label class="control-label">username</label>
<h:inputText type="email" placeholder="username" class="form-control"/> </div>
<div class="form-group"> <label class="control-label">Password</label>
<h:inputSecret type="password" id="inputPassword" placeholder="Password" class="form-control"/> </div>
<div class="checkbox"> <label>
<h:input type="checkbox"/> Keep me logged in </label> </div>
<small>Forgot password?</small>
<h:commandButton value="Sign in" class="btn btn-info"/>
<div class="line line-dashed"></div>
<div class="line line-dashed"></div>
<p class="text-muted text-center"><small>Do not have an account?</small></p>
Create an account
</h:form>
</section>
</div>
</div>
</section>
</body>
</html>

CSS And Other Few Elements Not Working In Express Website. Node.js

I am making a discord bot with website, and i have defined css and other stuff in .html file but its still not showing when i go to the website.
res.status(200).sendFile(path.resolve(__dirname, "../../website/command.html"))
})
Thats how i require the html file.
The Html File:
<html lang="en-US">
<head>
<title>Commandli</title>
<link rel="icon" href="https://cdn.discordapp.com/avatars/746706292562853888/0b578635739cbd7e5b076e65f2c04a4c.png?size=2048">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/commands.css" />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght#300;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<header class="header">
<img src="https://cdn.discordapp.com/avatars/"/> bot
<input class="menu-btn" type="checkbox" id="menu-btn" />
<label class="menu-icon" for="menu-btn"><span class="navicon"></span></label>
<ul class="menu">
<li>Home</li>
<li><a class="active" href="commands.html">Commands</a></li>
<li>About us</li>
<li>Contact us</li>
<li>Invite bot</li>
</ul>
</header>
<main>
<section class="tabs">
<div class="tab-header">
<div class="tablink tab-active" onclick="openCity(event,'Utility')">Utility</div>
<div class="tablink " onclick="openCity(event,'Fun')">Fun</div>
<div class="tablink" onclick="openCity(event,'Economy')">Economy</div>
<div class="tablink" onclick="openCity(event,'Info')">Info</div>
<div class="tablink" onclick="openCity(event,'Games')">Games</div>
<div class="tablink" onclick="openCity(event,'Misc')">Misc</div>
<div class="tablink" onclick="openCity(event,'All commands')">All commands</div>
</div>
<div style="margin-left:130px">
<div id="Utility" class="tab-content category" style="display:block">
<p><a>Utility commnads</a><br>Those commands help you with some things</p>
<p><a>=dungeon</a><br>Sends information about the current dungeon.</p>
<p><a>=help</a><br>Sends help!</p>
<p><a>=gamepedia</a><br>Search what you want on gamepedia</p>
<p><a>=welcome info</a><br>Information about the welcome system</p>
<p><a>Soon more!</a><br>Stay tuned!</p>
</div>
</div>
<script type="text/javascript" src="../js/commands.js"></script>
</section>
</main>
</body>
</html>
HTML file in bin = https://sourceb.in/DEA1wBlvs2
(Had to remove some code because it was huge)

jQuery easyui layout centering - one region overlaying another

I am trying to centre a button inside a region by using jQuery easyui layout feature:
<!DOCTYPE html>
<html style="height: 90%;">
<head>
<meta charset="UTF-8">
<title>The Analytic Platform - Home Page</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../themes/icon.css">
<link rel="stylesheet" type="text/css" href="demo.css">
<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<style>
.middle {
height:30%;
}
.topandbelow {
height:40%;
}
</style>
</head>
<body style="height: 90%;">
<h2>The Analytic Platform</h2>
<p>Easy analytics for everyone!</p>
<div id="p" class="easyui-panel" title="Step 1: Load data for analysis" style="width:100%;height:100%;padding:10px;">
<div class="easyui-layout" data-options="fit:true" style="width:100%;height:100%">
<div data-options="region:'west',split:false,border:true" style="width:40%;" title="Get data from Excel file">
<div class="easyui-layout" data-options="fit:true" style="width:100%;height:100%">
<div data-options="region:'centre',split:false,border:true" style="width:100%;">
<a href="ExcelUpload.html" class="easyui-linkbutton" >Upload Excel file</a>
</div>
</div>
</div>
<div data-options="region:'east',split:false,border:true" style="width:40%;height:100%" title="Get data from database">
<div class="easyui-layout" data-options="fit:false" style="width:100%;height:100%">
<div data-options="region:'north',split:false,border:true" class="topandbelow"></div>
<div data-options="region:'centre',split:false,border:true" class="middle">
Define Database Connection
</div>
<div data-options="region:'south',split:false,border:true" class="topandbelow"></div>
</div>
</div>
</div>
</div>
</body>
</html>
The "east" region is not displaying its nested "centre" region with the "north" region overlaying it.
What could be wrong in here?

Resources