https://github.com/latticemage/browser-tts
read selected content in browser
https://github.com/latticemage/browser-tts
flask geckodriver pyttsx3 selenium text-to-speech tts windows
Last synced: 2 months ago
JSON representation
read selected content in browser
- Host: GitHub
- URL: https://github.com/latticemage/browser-tts
- Owner: LatticeMage
- License: mit
- Created: 2025-02-01T16:49:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T12:51:03.000Z (over 1 year ago)
- Last Synced: 2025-02-25T13:36:17.971Z (over 1 year ago)
- Topics: flask, geckodriver, pyttsx3, selenium, text-to-speech, tts, windows
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Browser-TTS

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.
## Requirement
* Win10 have japanese lang installed
* Firefox browse ```about:profiles``` create new profile
* Browser driver such gecko, and Setting file ```config.ini``` :
```
[Settings]
gecko_driver_path =
firefox_profile_path = /home/you/.mozilla/firefox/xxxxxxxx.default-release
```
* env
```
pip install -r requirements.txt
```
## Usage
**Start the Flask server:**
```bash
python tts_server.py
```
**Run the frontend script:**
```bash
python frontend.py
```
Flow:
1. Open a web page in the Firefox instance launched by the script.
2. Select any text on the page.
3. A "Speak" button will appear near the selected text.
4. Click the "Speak" button.
5. The selected text will be spoken aloud.
## Configuration
change tts speed
```python
# Set a slower rate (default rate may be around 200). Experiment for best result.
self.engine.setProperty('rate', 150) # You can adjust this value
```
## License
This project is licensed under the [MIT License](LICENSE).