Text-to-Speech Converter
Features
Text Input:
- Users can type or paste the text they want to convert into speech.
Voice Selection:
- Allows users to select from available voices (male, female, and language-specific voices) using the Web Speech API.
Speech Playback:
- Plays the text as speech when the "Speak" button is clicked.
Stop Speech:
- Users can stop the speech playback using the "Stop" button.
Responsive Design:
- Fully responsive layout that adapts to different screen sizes.
Error Handling:
- Alerts users if no text is entered for conversion.
Cross-Browser Support:
- Works in modern browsers that support the Web Speech API.
How It Works
Web Speech API:
- The
speechSynthesisobject is used to convert text to speech. - The
getVoices()method fetches all available voices.
- The
Dynamic Voice List:
- The tool dynamically populates the dropdown menu with available voices.
Speech Management:
- The
SpeechSynthesisUtteranceobject is created to speak the text. - The
cancel()method stops any ongoing speech.
- The
Styling:
- The design is clean, vibrant, and responsive with user-friendly controls.
No comments:
Post a Comment