Skip to content

Commit

Permalink
Clean up and update README.md
Browse files Browse the repository at this point in the history
Release beta version
  • Loading branch information
dormant-user committed Sep 7, 2023
1 parent 913f979 commit 28aae53
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 1,010 deletions.
109 changes: 5 additions & 104 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,108 +1,9 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
.DS_Store
# python generated
.idea
.DS_Store
__pycache__
.pytest_cache
venv

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
docs/make.bat
docs/make.bat

# vscode
.vscode/
14 changes: 0 additions & 14 deletions MANIFEST

This file was deleted.

93 changes: 51 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,43 @@
<h2 align="center">Offline Text To Speech (TTS) converter for Python </h2>


[![Downloads](https://pepy.tech/badge/pyttsx3)](https://pepy.tech/project/pyttsx3) ![Downloads](https://pepy.tech/badge/pyttsx3/week) [![](https://img.shields.io/github/languages/code-size/nateshmbhat/pyttsx3.svg?style=plastic)](https://github.com/nateshmbhat/pyttsx3) [![](https://img.shields.io/github/license/nateshmbhat/pyttsx3?style=plastic)](https://github.com/nateshmbhat/pyttsx3) [![](https://img.shields.io/pypi/v/pyttsx3.svg?style=plastic)](https://pypi.org/project/pyttsx3/) [![](https://img.shields.io/github/languages/top/nateshmbhat/pyttsx3.svg?style=plastic)](https://github.com/nateshmbhat/pyttsx3) [![](https://img.shields.io/badge/author-nateshmbhat-green.svg)](https://github.com/nateshmbhat)
[![](https://pepy.tech/badge/py3-tts)](https://pepy.tech/badge/py3-tts)
[![](https://pepy.tech/badge/py3-tts/month)](https://pepy.tech/badge/py3-tts/month)

[![](https://img.shields.io/github/languages/code-size/thevickypedia/py3-tts.svg?style=plastic)](https://github.com/thevickypedia/py3-tts)
[![](https://img.shields.io/github/license/thevickypedia/py3-tts?style=plastic)](https://github.com/thevickypedia/py3-tts)

`pyttsx3` is a text-to-speech conversion library in Python. Unlike alternative libraries, **it works offline**.
[![](https://img.shields.io/pypi/v/py3-tts.svg?style=plastic)](https://pypi.org/project/py3-tts/)

<a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/nateshmbhat"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a coffee 😇"><span style="margin-left:5px;font-size:19px !important;">Buy me a coffee 😇</span></a>
[![](https://img.shields.io/github/languages/top/thevickypedia/py3-tts.svg?style=plastic)](https://github.com/thevickypedia/py3-tts)

## Installation :
[![](https://img.shields.io/badge/author-thevickypedia-green.svg)](https://github.com/thevickypedia)

`py3-tts` is a text-to-speech conversion library in Python. Unlike alternative libraries, **it works offline**.

pip install py3-tts
## Installation

> If you get installation errors , make sure you first upgrade your wheel version using :
`pip install --upgrade wheel`
```shell
pip install py3-tts
```

> If you get installation errors, make sure you first upgrade your wheel version using
### Linux installation requirements :
```shell
pip install --upgrade wheel
```

+ If you are on a linux system and if the voice output is not working , then :
### Linux installation requirements

Install espeak , ffmpeg and libespeak1 as shown below:
+ If you are on a linux system and if the voice output is not working,

```
sudo apt update && sudo apt install espeak ffmpeg libespeak1
```
Install `espeak`, `ffmpeg` and `libespeak1` as shown below

```shell
sudo apt update && sudo apt install espeak ffmpeg libespeak1
```

## Features :
## Features

- ✨Fully **OFFLINE** text to speech conversion
- 🎈 Choose among different voices installed in your system
Expand All @@ -39,77 +49,76 @@
- 📀 Save the speech audio as a file
- ❤️ Simple, powerful, & intuitive API

## Usage

## Usage :

```python3
```python
import pyttsx3

engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
```

**Single line usage with speak function with default options**

```python3
```python
import pyttsx3

pyttsx3.speak("I will speak this text")
```


**Changing Voice , Rate and Volume :**
**Changing Voice, Rate and Volume**

```python3
```python
import pyttsx3
engine = pyttsx3.init() # object creation

""" RATE"""
rate = engine.getProperty('rate') # getting details of current speaking rate
print (rate) #printing current voice rate
engine.setProperty('rate', 125) # setting up new voice rate
engine = pyttsx3.init() # object creation

""" RATE"""
rate = engine.getProperty('rate') # getting details of current speaking rate
print(rate) # printing current voice rate
engine.setProperty('rate', 125) # setting up new voice rate

"""VOLUME"""
volume = engine.getProperty('volume') #getting to know current volume level (min=0 and max=1)
print (volume) #printing current volume level
engine.setProperty('volume',1.0) # setting up volume level between 0 and 1
volume = engine.getProperty('volume') # getting to know current volume level (min=0 and max=1)
print(volume) # printing current volume level
engine.setProperty('volume', 1.0) # setting up volume level between 0 and 1

"""VOICE"""
voices = engine.getProperty('voices') #getting details of current voice
#engine.setProperty('voice', voices[0].id) #changing index, changes voices. o for male
engine.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female
voices = engine.getProperty('voices') # getting details of current voice
# engine.setProperty('voice', voices[0].id) #changing index, changes voices. o for male
engine.setProperty('voice', voices[1].id) # changing index, changes voices. 1 for female

engine.say("Hello World!")
engine.say('My current speaking rate is ' + str(rate))
engine.runAndWait()
engine.stop()


"""Saving Voice to a file"""
# On linux make sure that 'espeak' and 'ffmpeg' are installed
engine.save_to_file('Hello World', 'test.mp3')
engine.runAndWait()

```




### **Full documentation of the Library**
### Full documentation of the Library

https://pyttsx3.readthedocs.io/en/latest/


#### Included TTS engines:
#### Included TTS engines

* sapi5
* nsss
* espeak

Feel free to wrap another text-to-speech engine for use with ``pyttsx3``.

### Project Links :
### Project Links

* PyPI (https://pypi.python.org)
* GitHub (https://github.com/nateshmbhat/pyttsx3)
* PyPI (https://pypi.org/project/py3-tts/)
* GitHub (https://github.com/thevickypedia/py3-tts)
* Full Documentation (https://pyttsx3.readthedocs.org)

### Credits

**[nateshmbhat](https://github.com/nateshmbhat)** for the original code [pyttsx3](https://pypi.org/project/pyttsx3/)
92 changes: 0 additions & 92 deletions README.rst

This file was deleted.

Loading

0 comments on commit 28aae53

Please sign in to comment.