This project is a simple web application that converts speech to text using the Web Speech API. The application starts recording when the "Start Recording" button is clicked and stops recording when the "Stop Recording" button is clicked. The recognized speech is continuously appended to the textarea, allowing you to speak in multiple sentences without interruption.
- Continuous speech recognition until explicitly stopped
- Appends recognized speech to a textarea
- Simple and intuitive interface
- Uses the Web Speech API
To run this project, you need:
- A modern web browser that supports the Web Speech API (e.g., Google Chrome)
- A microphone connected to your computer
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/speech-to-text-web-app.git
-
Navigate to the project directory:
cd speech-to-text-web-app -
Open the
index.htmlfile in your web browser to run the application.
- Open the
index.htmlfile in a modern web browser. - Click the "Start Recording" button to begin speech recognition. Grant microphone permissions when prompted.
- Speak into your microphone. The recognized text will appear in the textarea.
- Click the "Stop Recording" button to end speech recognition.
The HTML file defines the structure of the web application, including the textarea for displaying the recognized text and the buttons for controlling the recording.
The CSS file styles the web application, providing a simple and clean user interface.
The JavaScript code handles the speech recognition functionality:
createRecognition(): Initializes the speech recognition object and sets up event handlers.startRecording(): Starts the speech recognition process and manages state.stopRecording(): Stops the speech recognition process and cleans up.
This application uses the Web Speech API, which is supported in the following browsers:
- Google Chrome (recommended)
- Microsoft Edge
- Safari
Note: The Web Speech API is not supported in all browsers. For the best experience, use Google Chrome.