The core functionality is triggered when a user selects text in the browser and clicks a dynamically injected "Speak" button. This repository implements a system that enables text-to-speech (TTS) functionality for selected text within a web browser using Selenium, Firefox, and a local Flask server.
- Win10 have japanese lang installed
- Browser driver such gecko, and Setting file
config.ini
:[Settings] gecko_driver_path = <path-to-gecko>
- env
pip install -r requirements.txt
Start the Flask server:
```bash
python tts_server.py
```
Run the frontend script:
```bash
python frontend.py
```
Flow:
- Open a web page in the Firefox instance launched by the script.
- Select any text on the page.
- A "Speak" button will appear near the selected text.
- Click the "Speak" button.
- The selected text will be spoken aloud.
change tts speed
# Set a slower rate (default rate may be around 200). Experiment for best result.
self.engine.setProperty('rate', 150) # You can adjust this value
This project is licensed under the MIT License.