SkillAgentSearch skills...

Winspeech

Speech recognition and synthesis library for Windows - Python 2 and 3.

Install / Use

/learn @areebbeigh/Winspeech
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

winspeech

Speech recognition and synthesis library for Windows - Python 2 and 3.

This is a simple Python library based on the abandoned <a href="https://github.com/michaelgundlach/pyspeech">PySpeech library</a> for Python 2. Requires <a href="https://sourceforge.net/projects/pywin32/files/pywin32/">pywin32.</a>

PyPI: https://pypi.python.org/pypi/winspeech<br> Doc: https://pythonhosted.org/winspeech/

Installation

> pip install winspeech

Example

# Say anything you type, and write anything you say.
# Stops when you say "turn off" or type "turn off".

import winspeech
import sys

# Start an in-process recognizer. Don't want the shared one with built-in windows commands.
winspeech.initialize_recognizer(winspeech.INPROC_RECOGNIZER)


def callback(phrase, listener):
    print(": %s" % phrase)
    if phrase == "turn off":
        winspeech.say("Goodbye.")
        listener.stop_listening()
        sys.exit()


print("Anything you type, speech will say back.")
print("Anything you say, speech will print out.")
print("Say or type 'turn off' to quit.")

listener = winspeech.listen_for_anything(callback)

while listener.is_listening():
    if sys.version_info.major == 3:
        text = input("> ")
    else:
        text = raw_input("> ")
    if text == "turn off":
        listener.stop_listening()
        sys.exit()
    else:
        winspeech.say(text)

Contributing

Feel free to fork the repo and make any improvements/additions. I love pull requests.

Additional Info

Developer: Areeb Beigh areebbeigh@gmail.com<br> GitHub Repo: https://github.com/areebbeigh/winspeech

Related Skills

View on GitHub
GitHub Stars12
CategoryDevelopment
Updated3y ago
Forks6

Languages

Python

Security Score

80/100

Audited on Sep 30, 2022

No findings