main
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 221 KiB |
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 198 KiB |
|
After Width: | Height: | Size: 233 KiB |
|
After Width: | Height: | Size: 222 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 241 KiB |
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Speech Synthesis API Example</title>
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
margin: 10px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.speech-text {
|
||||
margin-top: 20px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>مثال Speech Synthesis API</h1>
|
||||
<button onclick="speakText()">پخش متن</button>
|
||||
<div class="speech-text">Hello, welcome to our website!</div>
|
||||
|
||||
<script>
|
||||
function speakText() {
|
||||
const text = 'Hello, welcome to our website!';
|
||||
const utterance = new SpeechSynthesisUtterance(text);
|
||||
|
||||
// تنظیم زبان به انگلیسی
|
||||
utterance.lang = 'en-US';
|
||||
|
||||
// پخش صدا
|
||||
window.speechSynthesis.speak(utterance);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||