text to speech



Text to Speech Converter

Text to Speech Converter

body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { text-align: center; background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); max-width: 600px; width: 100%; } h1 { color: #007bff; } .text-input { width: 100%; height: 200px; padding: 10px; margin: 10px 0; border: 1px solid #ccc; border-radius: 5px; resize: none; } .controls { display: flex; justify-content: center; align-items: center; margin-top: 20px; } .language-select { margin-right: 10px; } .btn { background-color: #007bff; color: #fff; border: none; padding: 10px 20px; margin: 5px; border-radius: 5px; cursor: pointer; } const textInput = document.getElementById("textInput"); const languageSelect = document.getElementById("languageSelect"); const speakButton = document.getElementById("speakButton"); speakButton.addEventListener("click", () => { const text = textInput.value.trim(); const selectedLanguage = languageSelect.value; if (text !== "") { responsiveVoice.speak(text, selectedLanguage); } });