UniversalSpeech


NameUniversalSpeech JSON
Version 1.0.2.1 PyPI version JSON
download
home_pagehttps://github.com/MahmoudAtef999/PythonUniversalSpeech/
SummaryUniversalSpeech simplifies speech access in applications through a unified interface, supporting diverse methods such as screen readers, direct synthesis, and native/OS speech engines.
upload_time2023-12-30 21:13:07
maintainer
docs_urlNone
authorMahmoud Atef
requires_python
license
keywords speech accessibility screen readerjaws nvda
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PythonUniversalSpeech

## Overview:

The PythonUniversalSpeech library is a Python interface for interacting with the UniversalSpeech DLL, providing convenient functionality for speech synthesis and braille display. This library is compatible with both 32-bit and 64-bit versions of Python.

UniversalSpeech aims to streamline and simplify access to speech within applications. It accomplishes this by providing a unified interface that allows speech to be achieved through various means, including active screen readers, direct synthesis, or native/OS speech engines. The library dynamically adapts based on what is available and supported, offering a cohesive and versatile solution for speech-related functionalities.

PythonUniversalSpeech is built upon the UniversalSpeech, initially developed by [qtnc](https://github.com/qtnc). To learn more about the project and its details, you can visit the [UniversalSpeech GitHub repository](https://github.com/qtnc/UniversalSpeech).

## Supported engines:

- Jaws for windows.
- NVDA 2011.1 or above.
- Windows eye.
- System access.
- Supernova.
- Cobra, partially.
- SAPI 5.
- ZDSRAPI

## Installation:

To install the UniversalSpeech library, you can use the following pip command:

```bash
pip install UniversalSpeech
```

Alternatively, you can download the project directly from [the GitHub repository here](https://github.com/MahmoudAtef999/PythonUniversalSpeech) and use it in your Python project.

## Usage:

### UniversalSpeech Class:

The `UniversalSpeech` class provides a simplified interface for workingwith the UniversalSpeech DLL.

### Attributes:

- `engine_used` (str): Returns the name of the currently used speech engine.
- `rate_supported` (bool): Indicates whether setting the speech rate is supported in the current engine.
- `volume_supported` (bool): Indicates whether setting the speech volume is supported in the current engine.
- `pitch_supported` (bool): Indicates whether setting the speech pitch is supported in the current engine.
- `inflexion_supported` (bool): Indicates whether setting the speech inflexion is supported in the current engine.

### Methods:

- `say(msg: str, interrupt: bool = True) -> None`: 
  - Says the given message using the speech engine.

- `say_a(msg: str, interrupt: bool = True) -> None`: 
  - Says the first letter of the given message using the speech engine.

- `braille(msg: str) -> None`: 
  - Displays the given message in braille.

- `speech(msg: str) -> None`: 
  - Performs both speech and braille display for the given message.

- `speech_a(msg: str) -> None`: 
  - Performs  speech_a and braille  for the given message.

- `stop() -> None`: 
  - Stops the speech.

- `get_value(what) -> int`: 
  - Gets the current value of a specific speech parameter.
  - Note: You can see the available parameters by looking at the beginning of [this file](https://github.com/MahmoudAtef999/PythonUniversalSpeech/blob/main/UniversalSpeech/__init__.py).

- `set_value(what, value) -> None`: 
  - Sets the value of a specific speech parameter.

- `get_string(what) -> str`: 
  - Gets a string representation of a specific speech parameter.

- `enable_native_speech(enabled: bool = True) -> None`: 
  - Determines whether to use native speech engines, such as SAPI on Windows, that are generally reliable and can be used when no other engines are available. 
  - If enabled is set to True, native speech engines are used; if set to False, speech is ignored in such cases.

- `get_engines() -> List[Dict]`: 
  - Gets a list of available speech engines with their names, availability, and IDs.

- `set_rate(value: int, min_rate: int = None, max_rate: int = None) -> None`: 
  - Sets the speech rate and, optionally, the minimum and maximum rates.

- `set_volume(value: int, min_volume: int = None, max_volume: int = None) -> None`: 
  - Sets the speech volume and, optionally, the minimum and maximum volume.

- `set_pitch(value: int, min_pitch: int = None, max_pitch: int = None) -> None`: 
  - Sets the speech pitch and, optionally, the minimum and maximum pitch.

- `set_inflexion(value: int, min_inflexion: int = None, max_inflexion: int = None) -> None`: 
  - Sets the speech inflexion and, optionally, the minimum and maximum inflexion.

## Exceptions:

- `DLLFileNotFoundError(Exception)`: 
  - Raised when one or more required DLL files are missing.

- `UnsupportedError(Exception)`: 
  - Raised when a specific function is not supported with the current engine.

## Example:

```python
import UniversalSpeech

# Create an instance of UniversalSpeech
uspeech = UniversalSpeech.UniversalSpeech()

# Enable the use of native speech engines such as SAPI 
uspeech.enable_native_speech(True)

#Say a message
uspeech.say("Hello, world.")

# Display a message in braille
uspeech.braille("Hello, world.")

# Get engine used
engine_used = uspeech.engine_used
print("You are using {}.".format(engine_used))

# Get list of available engins
available_engines = uspeech.get_engines()
print(available_engines)

# set the rate if it is supported
try:
    uspeech.set_rate(150)
except UniversalSpeech.exceptions.UnsupportedError as e:
    print(e)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MahmoudAtef999/PythonUniversalSpeech/",
    "name": "UniversalSpeech",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "speech,accessibility,screen readerjaws,nvda",
    "author": "Mahmoud Atef",
    "author_email": "mahmoud.atef.987123@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/57/c5/377328e962010b8de8d84b2ab2e49e5f7ae311a598fd87118da4c4cc0874/UniversalSpeech-1.0.2.1.tar.gz",
    "platform": null,
    "description": "# PythonUniversalSpeech\r\n\r\n## Overview:\r\n\r\nThe PythonUniversalSpeech library is a Python interface for interacting with the UniversalSpeech DLL, providing convenient functionality for speech synthesis and braille display. This library is compatible with both 32-bit and 64-bit versions of Python.\r\n\r\nUniversalSpeech aims to streamline and simplify access to speech within applications. It accomplishes this by providing a unified interface that allows speech to be achieved through various means, including active screen readers, direct synthesis, or native/OS speech engines. The library dynamically adapts based on what is available and supported, offering a cohesive and versatile solution for speech-related functionalities.\r\n\r\nPythonUniversalSpeech is built upon the UniversalSpeech, initially developed by [qtnc](https://github.com/qtnc). To learn more about the project and its details, you can visit the [UniversalSpeech GitHub repository](https://github.com/qtnc/UniversalSpeech).\r\n\r\n## Supported engines:\r\n\r\n- Jaws for windows.\r\n- NVDA 2011.1 or above.\r\n- Windows eye.\r\n- System access.\r\n- Supernova.\r\n- Cobra, partially.\r\n- SAPI 5.\r\n- ZDSRAPI\r\n\r\n## Installation:\r\n\r\nTo install the UniversalSpeech library, you can use the following pip command:\r\n\r\n```bash\r\npip install UniversalSpeech\r\n```\r\n\r\nAlternatively, you can download the project directly from [the GitHub repository here](https://github.com/MahmoudAtef999/PythonUniversalSpeech) and use it in your Python project.\r\n\r\n## Usage:\r\n\r\n### UniversalSpeech Class:\r\n\r\nThe `UniversalSpeech` class provides a simplified interface for workingwith the UniversalSpeech DLL.\r\n\r\n### Attributes:\r\n\r\n- `engine_used` (str): Returns the name of the currently used speech engine.\r\n- `rate_supported` (bool): Indicates whether setting the speech rate is supported in the current engine.\r\n- `volume_supported` (bool): Indicates whether setting the speech volume is supported in the current engine.\r\n- `pitch_supported` (bool): Indicates whether setting the speech pitch is supported in the current engine.\r\n- `inflexion_supported` (bool): Indicates whether setting the speech inflexion is supported in the current engine.\r\n\r\n### Methods:\r\n\r\n- `say(msg: str, interrupt: bool = True) -> None`: \r\n  - Says the given message using the speech engine.\r\n\r\n- `say_a(msg: str, interrupt: bool = True) -> None`: \r\n  - Says the first letter of the given message using the speech engine.\r\n\r\n- `braille(msg: str) -> None`: \r\n  - Displays the given message in braille.\r\n\r\n- `speech(msg: str) -> None`: \r\n  - Performs both speech and braille display for the given message.\r\n\r\n- `speech_a(msg: str) -> None`: \r\n  - Performs  speech_a and braille  for the given message.\r\n\r\n- `stop() -> None`: \r\n  - Stops the speech.\r\n\r\n- `get_value(what) -> int`: \r\n  - Gets the current value of a specific speech parameter.\r\n  - Note: You can see the available parameters by looking at the beginning of [this file](https://github.com/MahmoudAtef999/PythonUniversalSpeech/blob/main/UniversalSpeech/__init__.py).\r\n\r\n- `set_value(what, value) -> None`: \r\n  - Sets the value of a specific speech parameter.\r\n\r\n- `get_string(what) -> str`: \r\n  - Gets a string representation of a specific speech parameter.\r\n\r\n- `enable_native_speech(enabled: bool = True) -> None`: \r\n  - Determines whether to use native speech engines, such as SAPI on Windows, that are generally reliable and can be used when no other engines are available. \r\n  - If enabled is set to True, native speech engines are used; if set to False, speech is ignored in such cases.\r\n\r\n- `get_engines() -> List[Dict]`: \r\n  - Gets a list of available speech engines with their names, availability, and IDs.\r\n\r\n- `set_rate(value: int, min_rate: int = None, max_rate: int = None) -> None`: \r\n  - Sets the speech rate and, optionally, the minimum and maximum rates.\r\n\r\n- `set_volume(value: int, min_volume: int = None, max_volume: int = None) -> None`: \r\n  - Sets the speech volume and, optionally, the minimum and maximum volume.\r\n\r\n- `set_pitch(value: int, min_pitch: int = None, max_pitch: int = None) -> None`: \r\n  - Sets the speech pitch and, optionally, the minimum and maximum pitch.\r\n\r\n- `set_inflexion(value: int, min_inflexion: int = None, max_inflexion: int = None) -> None`: \r\n  - Sets the speech inflexion and, optionally, the minimum and maximum inflexion.\r\n\r\n## Exceptions:\r\n\r\n- `DLLFileNotFoundError(Exception)`: \r\n  - Raised when one or more required DLL files are missing.\r\n\r\n- `UnsupportedError(Exception)`: \r\n  - Raised when a specific function is not supported with the current engine.\r\n\r\n## Example:\r\n\r\n```python\r\nimport UniversalSpeech\r\n\r\n# Create an instance of UniversalSpeech\r\nuspeech = UniversalSpeech.UniversalSpeech()\r\n\r\n# Enable the use of native speech engines such as SAPI \r\nuspeech.enable_native_speech(True)\r\n\r\n#Say a message\r\nuspeech.say(\"Hello, world.\")\r\n\r\n# Display a message in braille\r\nuspeech.braille(\"Hello, world.\")\r\n\r\n# Get engine used\r\nengine_used = uspeech.engine_used\r\nprint(\"You are using {}.\".format(engine_used))\r\n\r\n# Get list of available engins\r\navailable_engines = uspeech.get_engines()\r\nprint(available_engines)\r\n\r\n# set the rate if it is supported\r\ntry:\r\n    uspeech.set_rate(150)\r\nexcept UniversalSpeech.exceptions.UnsupportedError as e:\r\n    print(e)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "UniversalSpeech simplifies speech access in applications through a unified interface, supporting diverse methods such as screen readers, direct synthesis, and native/OS speech engines.",
    "version": "1.0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/MahmoudAtef999/PythonUniversalSpeech/"
    },
    "split_keywords": [
        "speech",
        "accessibility",
        "screen readerjaws",
        "nvda"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "def5aac2dcc175f4ccd24d2bb399cab30199843490b8b6bc141583886b9dcdff",
                "md5": "6ed7c9923a9d86cd25e09d14f42eba68",
                "sha256": "d94681d08dacf1f0b51925cf0cec121a97a51a7998298257b7a24d6c681810d7"
            },
            "downloads": -1,
            "filename": "UniversalSpeech-1.0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6ed7c9923a9d86cd25e09d14f42eba68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 882473,
            "upload_time": "2023-12-30T21:13:01",
            "upload_time_iso_8601": "2023-12-30T21:13:01.837426Z",
            "url": "https://files.pythonhosted.org/packages/de/f5/aac2dcc175f4ccd24d2bb399cab30199843490b8b6bc141583886b9dcdff/UniversalSpeech-1.0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57c5377328e962010b8de8d84b2ab2e49e5f7ae311a598fd87118da4c4cc0874",
                "md5": "c65bb8278bb3c65b8cedebe23b9d15cb",
                "sha256": "1b905aec77d627539847fdd802bd59996dd635b02a56cfb59682661d5f1c9d81"
            },
            "downloads": -1,
            "filename": "UniversalSpeech-1.0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c65bb8278bb3c65b8cedebe23b9d15cb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 882947,
            "upload_time": "2023-12-30T21:13:07",
            "upload_time_iso_8601": "2023-12-30T21:13:07.029423Z",
            "url": "https://files.pythonhosted.org/packages/57/c5/377328e962010b8de8d84b2ab2e49e5f7ae311a598fd87118da4c4cc0874/UniversalSpeech-1.0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-30 21:13:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MahmoudAtef999",
    "github_project": "PythonUniversalSpeech",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "universalspeech"
}
        
Elapsed time: 1.48942s