Skip to main content

WebSpeechRecognition Library

Introduction

WebSpeechRecognition is a Python library that helps turn speech into text in real time. It uses the Selenium WebDriver and the HTML5 Web Speech API. This tool is built to work with Chrome WebDriver and is easy to use for speech recognition tasks.

Installation

To install WebSpeechRecognition, you can use pip:

pip install WebSpeechRecognition

Features

  • Works in Many Languages: You can set the language you want using simple codes like "en-US" for English.
  • Change Language Easily: You can pick a language at any time while using it.
  • Simple Functions: It has easy-to-understand methods to start and stop speech recognition.

Usage

Initialization

To start using WebSpeechRecognition, initialize the SpeechRecognition class with the path to your ChromeDriver executable and the language code:

from WebSpeechRecognition import SpeechRecognition

recognizer = SpeechRecognition("path/to/chromedriver", language="en-US")
recognizer.Init()

Speech Recognition

To start listening and transcribing speech, use the Listen method. This method returns the transcribed text:

text = recognizer.Listen(print_allowed=True)
print(f"You said: {text}")

Close the Driver

Once you are done, use the Quit method to close the ChromeDriver instance:

recognizer.Quit()

Examples

Here is a complete example:

from WebSpeechRecognition import SpeechRecognition

recognizer = SpeechRecognition("path/to/chromedriver", language="en-US")
recognizer.Init()

while True:
    try:
        text = recognizer.Listen(print_allowed=True)
        print(f"You said: {text}")
    except KeyboardInterrupt:
        recognizer.Quit()
        break

Parameters

SpeechRecognition(driver_path, language)

  • driver_path: The path to the Chrome WebDriver file.
  • language: The language code for recognition (default: "en-US").

Init()

Sets up the WebDriver with options for speech recognition.

Listen(print_allowed=False)

Starts listening and returns the text it hears.

  • print_allowed: If True, prints recognized text to the console.

Quit()

Stops the WebDriver and closes everything.

Contributing

We welcome contributions! If you find a bug or have an idea for a new feature, feel free to open an issue or a pull request on our GitHub repository.

Want to help improve SpeechRecognition? Here's how:

  1. Fork the repository.
  2. Make a new branch (git checkout -b feature-branch).
  3. Add your changes (git commit -m 'Add feature').
  4. Push your branch (git push origin feature-branch).
  5. Open a pull request for review.

License

This project uses the MIT License. See the LICENSE file for details.

Contact

Have questions or suggestions? Contact us:

Metadata

Release files for WebSpeechRecognition 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WebSpeechRecognition 0.1.4
File Size Uploaded Provenance
WebSpeechRecognition-0.1.4.tar.gz 4.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for WebSpeechRecognition 0.1.4
File Interpreter ABI Platform
WebSpeechRecognition-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / WebSpeechRecognition-0.1.4.tar.gz

Download URL WebSpeechRecognition-0.1.4.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3d94b2cb0b086482ac5f088ef0cbb2bde0e21a6ee8b1800699d31c7ad311bef5
BLAKE2b-256 checksum
How to use checksums
d4c3295d46683cd169df97eb461541b3aa897cc3210b4f2c5d4fe00bb4fc3511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.0

Release files / WebSpeechRecognition-0.1.4-py3-none-any.whl

Download URL WebSpeechRecognition-0.1.4-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f39b01d3c435fdcdb13711405ee3fb5371749d56d5b2ca55a92c6da8d41c126
BLAKE2b-256 checksum
How to use checksums
780294186fa083f70a51e32350ce3a3f3d272e6d85b725866a80461eded33b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.8.0

Security for WebSpeechRecognition 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page