Skip to content

Instantly share code, notes, and snippets.

@cyb3rsalih
Created May 23, 2025 06:38
Show Gist options
  • Save cyb3rsalih/c9bd7f146381e23e638efee7ac443387 to your computer and use it in GitHub Desktop.
Save cyb3rsalih/c9bd7f146381e23e638efee7ac443387 to your computer and use it in GitHub Desktop.
Google Chrome Supports Offline Text-to-Speech
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>Text-to-Speech Demo</title>
</head>
<body>
<h1>Text-to-Speech Demo</h1>
<p>Bir metin girin ve 'Oku' butonuna tıklayın:</p>
<textarea id="text-to-speak" rows="4" cols="50">Selamun aleykum ben Google Chrome üzerinde offline olarak çalışan bir text-to-speech apisiyim</textarea><br>
<button onclick="speak()">Oku</button>
<script>
function speak() {
const textInput = document.getElementById('text-to-speak');
const text = textInput.value;
if ('speechSynthesis' in window) {
const msg = new SpeechSynthesisUtterance();
msg.text = text;
msg.lang = 'tr-TR'; // Dil kodunu ihtiyacınıza göre ayarlayın
window.speechSynthesis.speak(msg);
} else {
alert('Bu tarayıcıda speech synthesis desteklenmiyor.');
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment