NBSapi


NameNBSapi JSON
Version 0.6 PyPI version JSON
download
home_pagehttps://github.com/baaziznasser/nbsapi
Summarya python library that helps you to control the sapi5 TTS
upload_time2022-12-02 21:16:29
maintainer
docs_urlNone
authornacer baaziz
requires_python>=3
licenseGPL-3.0
keywords nbsapi nbsapi sapi tts python text to speech audio screen reader voices sapi5 spvoice text to speech audio book
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NBSapi
## what is NBSapi
the NBSapi is a python library that can help you to convert your text to speech, where you can hear it directly or save it to an audio file.\
it currently working only on windows with sapi5
## requirements
to use the NBSapi you just need to install the comtypes library by using\
pip install comtypes
## install NBSapi
to install NBSapi you can use PIP\
pip install NBSapi
## usage

to use the library you need to import it\
from NBSapi import NBSapi\
import time\
#load the class\
TTS = NBSapi()\
#speak a text and wait\
TTS.Speak("hello")\
#speak without wait, (note: this step is required if you want to control the speech)\
TTS.Speak("hello", 1)\
#wait 0.1 sec before stop the speech\
time.sleep(0.1)\
TTS.Stop()

## whats new
* solved a lot of problems
* added function to check if sapi is avalable and working without any problems

## class functions
this library has a lot of functions that make the sapi 5 tts easy
### is_sapi
is_sapi()\
this function will return true or false\

### Speak
Speak(text (string), flag (int))\
this is the function that will speek text\
you can use the flags that exists on the lib file\

### SpeakToFile
SpeakToFile(text (string), file (string), flags (int))\
create an audio file with the giving text and path

### Pause
Pause()\
pause the speech

### Resume
Resume()\
resume the speech

### Stop
Stop()\
Stop the Speech

### GetVoice
GetVoice()\
get the current voice information as a dict

### SetVoice
SetVoice(voice (index, description, attribute, or object), key ("by_index", "by_description", "by_attribute", or "" for voice object))\
Set the current voice, even by description, by attribute, by index starting from 0, or by object


### GetVolume
GetVolume()\
Get the Current volume

### SetVolume
SetVolume(vol (int))\
set the Current volume

### GetRate
GetRate()\
Get the Current Rate

### SetRate
SetRate(Rate (int))\
Set the Rate of the voice Between -10 and 10

### GetVoices
GetVoices(attrs = "")\
Get a list of dicts, each item has a voice information\
so, you can use this list indexes to set the voice, it has the same order.\
here also you can use attributes to get just the voices you need (take a look to tests folder)

### GetAttribute
GetAttribute(attr (string))\
get an attribute of the selected voice such as Name, Age, Language, and Gender.

### GetStatus(
GetStatus(Property (string))\
Get a state of any thing you want, you can use the declared variable that start with STS_

### GetObject
get the current SPVoice object


## notes:
this library is new, so i will add a features to it as i can.\
if you have any idea about this library please help with it.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/baaziznasser/nbsapi",
    "name": "NBSapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "nbsapi,NBSapi,Sapi,tts,python text to speech,audio,screen reader,voices,sapi5,spvoice,text to speech,audio book",
    "author": "nacer baaziz",
    "author_email": "Nacer Baaziz <nacerbaaziz@ng-space.com>",
    "download_url": "https://files.pythonhosted.org/packages/91/32/811c64e83e0bec21df9913a801b4c378ed2513cd22f23f177411328f6c50/NBSapi-0.6.tar.gz",
    "platform": null,
    "description": "# NBSapi\r\n## what is NBSapi\r\nthe NBSapi is a python library that can help you to convert your text to speech, where you can hear it directly or save it to an audio file.\\\r\nit currently working only on windows with sapi5\r\n## requirements\r\nto use the NBSapi you just need to install the comtypes library by using\\\r\npip install comtypes\r\n## install NBSapi\r\nto install NBSapi you can use PIP\\\r\npip install NBSapi\r\n## usage\r\n\r\nto use the library you need to import it\\\r\nfrom NBSapi import NBSapi\\\r\nimport time\\\r\n#load the class\\\r\nTTS = NBSapi()\\\r\n#speak a text and wait\\\r\nTTS.Speak(\"hello\")\\\r\n#speak without wait, (note: this step is required if you want to control the speech)\\\r\nTTS.Speak(\"hello\", 1)\\\r\n#wait 0.1 sec before stop the speech\\\r\ntime.sleep(0.1)\\\r\nTTS.Stop()\r\n\r\n## whats new\r\n* solved a lot of problems\r\n* added function to check if sapi is avalable and working without any problems\r\n\r\n## class functions\r\nthis library has a lot of functions that make the sapi 5 tts easy\r\n### is_sapi\r\nis_sapi()\\\r\nthis function will return true or false\\\r\n\r\n### Speak\r\nSpeak(text (string), flag (int))\\\r\nthis is the function that will speek text\\\r\nyou can use the flags that exists on the lib file\\\r\n\r\n### SpeakToFile\r\nSpeakToFile(text (string), file (string), flags (int))\\\r\ncreate an audio file with the giving text and path\r\n\r\n### Pause\r\nPause()\\\r\npause the speech\r\n\r\n### Resume\r\nResume()\\\r\nresume the speech\r\n\r\n### Stop\r\nStop()\\\r\nStop the Speech\r\n\r\n### GetVoice\r\nGetVoice()\\\r\nget the current voice information as a dict\r\n\r\n### SetVoice\r\nSetVoice(voice (index, description, attribute, or object), key (\"by_index\", \"by_description\", \"by_attribute\", or \"\" for voice object))\\\r\nSet the current voice, even by description, by attribute, by index starting from 0, or by object\r\n\r\n\r\n### GetVolume\r\nGetVolume()\\\r\nGet the Current volume\r\n\r\n### SetVolume\r\nSetVolume(vol (int))\\\r\nset the Current volume\r\n\r\n### GetRate\r\nGetRate()\\\r\nGet the Current Rate\r\n\r\n### SetRate\r\nSetRate(Rate (int))\\\r\nSet the Rate of the voice Between -10 and 10\r\n\r\n### GetVoices\r\nGetVoices(attrs = \"\")\\\r\nGet a list of dicts, each item has a voice information\\\r\nso, you can use this list indexes to set the voice, it has the same order.\\\r\nhere also you can use attributes to get just the voices you need (take a look to tests folder)\r\n\r\n### GetAttribute\r\nGetAttribute(attr (string))\\\r\nget an attribute of the selected voice such as Name, Age, Language, and Gender.\r\n\r\n### GetStatus(\r\nGetStatus(Property (string))\\\r\nGet a state of any thing you want, you can use the declared variable that start with STS_\r\n\r\n### GetObject\r\nget the current SPVoice object\r\n\r\n\r\n## notes:\r\nthis library is new, so i will add a features to it as i can.\\\r\nif you have any idea about this library please help with it.\r\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "a python library that helps you to control the sapi5 TTS",
    "version": "0.6",
    "split_keywords": [
        "nbsapi",
        "nbsapi",
        "sapi",
        "tts",
        "python text to speech",
        "audio",
        "screen reader",
        "voices",
        "sapi5",
        "spvoice",
        "text to speech",
        "audio book"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "ba9a1af110feb5e51686123f279bdb16",
                "sha256": "59c5f6fc62ae8b8acae6d0e88c8af0420f8a1213ded410d0985f667bde51d5a9"
            },
            "downloads": -1,
            "filename": "NBSapi-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba9a1af110feb5e51686123f279bdb16",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 19192,
            "upload_time": "2022-12-02T21:16:26",
            "upload_time_iso_8601": "2022-12-02T21:16:26.004417Z",
            "url": "https://files.pythonhosted.org/packages/d0/60/2c7f02a86665f0163430e3bba6e72da2f6b5baa34a560cce6797f5871865/NBSapi-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "c9efe3e7a114d15372f87bfafbe5af81",
                "sha256": "cb566b70eb918d0fb4e7d5f2e25c9d289cc3d3e3a9f5a9d270916253b7fdfe8f"
            },
            "downloads": -1,
            "filename": "NBSapi-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "c9efe3e7a114d15372f87bfafbe5af81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 17861,
            "upload_time": "2022-12-02T21:16:29",
            "upload_time_iso_8601": "2022-12-02T21:16:29.224700Z",
            "url": "https://files.pythonhosted.org/packages/91/32/811c64e83e0bec21df9913a801b4c378ed2513cd22f23f177411328f6c50/NBSapi-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-02 21:16:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "baaziznasser",
    "github_project": "nbsapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nbsapi"
}
        
Elapsed time: 0.02918s