diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 0000000..cd5f1d0 --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Build and upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*.whl diff --git a/.gitignore b/.gitignore index a2fd6ed..1eb6fff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ *.py[cod] *$py.class +.DS_Store # C extensions *.so @@ -103,4 +104,4 @@ docs/make.bat docs/make.bat # vscode -.vscode/ \ No newline at end of file +.vscode/ diff --git a/example/main.py b/example/main.py new file mode 100644 index 0000000..fdc3af0 --- /dev/null +++ b/example/main.py @@ -0,0 +1,23 @@ +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 + + +"""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 + +"""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 + +engine.say("Hello World!") +engine.say('My current speaking rate is ' + str(rate)) +engine.runAndWait() +engine.stop() \ No newline at end of file diff --git a/example/voicefile.mp3 b/example/voicefile.mp3 new file mode 100644 index 0000000..a5ec83f Binary files /dev/null and b/example/voicefile.mp3 differ diff --git a/makefile b/makefile index a9da7b0..0bf7b97 100644 --- a/makefile +++ b/makefile @@ -7,3 +7,7 @@ build: upload: pip3 install twine python3 -m twine upload dist/*.whl +deploy: + make clean + make build + make upload diff --git a/setup.py b/setup.py index db24245..f74b05c 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ name='pyttsx3', packages=['pyttsx3', 'pyttsx3.drivers'], version='2.86', - description='Text to Speech (TTS) library for Python 2 and 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak.', + description='Text to Speech (TTS) library for Python 2 and 3. Works without internet connection or delay. Supports multiple TTS engines, including Sapi5, nsss, and espeak.', long_description=long_description, summary='Offline Text to Speech library with multi-engine support', author='Natesh M Bhat',