cloud-tts-tool


Namecloud-tts-tool JSON
Version 0.0.74 PyPI version JSON
download
home_page
SummaryA tool for requesting text to speech from a variety of cloud APIs.
upload_time2023-06-12 01:23:46
maintainer
docs_urlNone
author
requires_python>=3.9
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cloud TTS

This package is in development but will allow you to easily connect to a variety of text to speach apis.

Please set keyring items:

Google Cloud:
https://cloud.google.com/iam/docs/service-accounts-create
```python
#python console
import keyring
keyring.set_password("cloud_tts", "google_private_key_id", "<GOOGLE_PRIVATE_KEY_ID_FROM_JSON>")
keyring.set_password("cloud_tts", "google_private_key", "<GOOGLE_PRIVATE_KEY_FROM_JSON>")
keyring.set_password("cloud_tts", "google_client_email", "<GOOGLE_CLIENT_EMAIL>")
```
The other items don't appear to matter.

#AWS Polly:
in console, IAM, Users, Add user,
choose a username 
Attatch Policies Directly
select only "AmazonPollyReadOnlyAccess"
Create User, copy Access key ID and Secret access key and add them to your keychain

```python
#python console
import keyring

keyring.set_password("aws_tts", "aws_access_key_id", "<AWS_ACCESS_KEY_ID>")
keyring.set_password("aws_tts", "aws_secret_access_key", "<AWS_SECRET_ACCESS_KEY>")`
```
#Microsoft Azure:
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=script%2Cwindowsinstall&pivots=programming-language-python
Create Speech Services resource
Pay-as-you-go/DefaultResourceGroup-CUS
Choose region
Name resource (don't use spaces or underscores)
Chose pricing tier (free allows for about an hour of neural voice per month)
Network type: Selected Network
create new virtual network and subnet
put your ip address in the firewall  (https://www.google.com/search?q=what+is+my+ip)
Review and Create
Create

From home you should see the name of your resource, click on it
Click Manage Keys
Copy Key 1 and add it to your keychain
Copy Location/Region and add it to your keychain (not really a secret, but since 
your key is tied to a region, it's nice to have it in the same place)

```python
#python console
import keyring
keyring.set_password("azure_tts", "azure_key", "<AZURE_KEY_1>")
keyring.set_password("azure_tts", "azure_region", "<AZURE_REGION>")
```

# Usage

```python
import keyring
from cloud_tts import get_voices

platform = "google" # or "aws" or "azure"
voice_list = get_voices(platform)

# print out the voices
for voice in voice_list:
    print(f'{voice["id"]} {voice["name"]} {voice["language"]}')
```

Send text to cloud

```python
from cloud_tts import make_tts, example_text

audio_content = make_tts(text =example_text(), voice="en-US-Wavenet-A", platform="google", loc="en_US", gender="FEMALE")

#save audio
filename = "example.mp3"
with open("example.mp3", "wb") as f:
    f.write(audio_content)
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cloud-tts-tool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Ben Brenner <ben.brenner@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/b5/dc08c3f5b3361f9d58b88e05a29012eaeabfd4cfa47840e6cacc812eda42/cloud_tts_tool-0.0.74.tar.gz",
    "platform": null,
    "description": "# Cloud TTS\n\nThis package is in development but will allow you to easily connect to a variety of text to speach apis.\n\nPlease set keyring items:\n\nGoogle Cloud:\nhttps://cloud.google.com/iam/docs/service-accounts-create\n```python\n#python console\nimport keyring\nkeyring.set_password(\"cloud_tts\", \"google_private_key_id\", \"<GOOGLE_PRIVATE_KEY_ID_FROM_JSON>\")\nkeyring.set_password(\"cloud_tts\", \"google_private_key\", \"<GOOGLE_PRIVATE_KEY_FROM_JSON>\")\nkeyring.set_password(\"cloud_tts\", \"google_client_email\", \"<GOOGLE_CLIENT_EMAIL>\")\n```\nThe other items don't appear to matter.\n\n#AWS Polly:\nin console, IAM, Users, Add user,\nchoose a username \nAttatch Policies Directly\nselect only \"AmazonPollyReadOnlyAccess\"\nCreate User, copy Access key ID and Secret access key and add them to your keychain\n\n```python\n#python console\nimport keyring\n\nkeyring.set_password(\"aws_tts\", \"aws_access_key_id\", \"<AWS_ACCESS_KEY_ID>\")\nkeyring.set_password(\"aws_tts\", \"aws_secret_access_key\", \"<AWS_SECRET_ACCESS_KEY>\")`\n```\n#Microsoft Azure:\nhttps://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=script%2Cwindowsinstall&pivots=programming-language-python\nCreate Speech Services resource\nPay-as-you-go/DefaultResourceGroup-CUS\nChoose region\nName resource (don't use spaces or underscores)\nChose pricing tier (free allows for about an hour of neural voice per month)\nNetwork type: Selected Network\ncreate new virtual network and subnet\nput your ip address in the firewall  (https://www.google.com/search?q=what+is+my+ip)\nReview and Create\nCreate\n\nFrom home you should see the name of your resource, click on it\nClick Manage Keys\nCopy Key 1 and add it to your keychain\nCopy Location/Region and add it to your keychain (not really a secret, but since \nyour key is tied to a region, it's nice to have it in the same place)\n\n```python\n#python console\nimport keyring\nkeyring.set_password(\"azure_tts\", \"azure_key\", \"<AZURE_KEY_1>\")\nkeyring.set_password(\"azure_tts\", \"azure_region\", \"<AZURE_REGION>\")\n```\n\n# Usage\n\n```python\nimport keyring\nfrom cloud_tts import get_voices\n\nplatform = \"google\" # or \"aws\" or \"azure\"\nvoice_list = get_voices(platform)\n\n# print out the voices\nfor voice in voice_list:\n    print(f'{voice[\"id\"]} {voice[\"name\"]} {voice[\"language\"]}')\n```\n\nSend text to cloud\n\n```python\nfrom cloud_tts import make_tts, example_text\n\naudio_content = make_tts(text =example_text(), voice=\"en-US-Wavenet-A\", platform=\"google\", loc=\"en_US\", gender=\"FEMALE\")\n\n#save audio\nfilename = \"example.mp3\"\nwith open(\"example.mp3\", \"wb\") as f:\n    f.write(audio_content)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A tool for requesting text to speech from a variety of cloud APIs.",
    "version": "0.0.74",
    "project_urls": {
        "Bug Tracker": "https://github.com/cobiadigital/cloud_tts_tools/issues",
        "Homepage": "https://github.com/cobiadigital/cloud_tts_tools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eea11f0ded508bbe3f9564e61e7c694e596344b906a361c5cf550fae13abea77",
                "md5": "438fd89b967b29242bfe6ee33115baee",
                "sha256": "df6785af665ac8ab4834b5cebb8016b9ee91d7f04f56cbc7bc5603974fa98968"
            },
            "downloads": -1,
            "filename": "cloud_tts_tool-0.0.74-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "438fd89b967b29242bfe6ee33115baee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7460,
            "upload_time": "2023-06-12T01:23:44",
            "upload_time_iso_8601": "2023-06-12T01:23:44.594964Z",
            "url": "https://files.pythonhosted.org/packages/ee/a1/1f0ded508bbe3f9564e61e7c694e596344b906a361c5cf550fae13abea77/cloud_tts_tool-0.0.74-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7b5dc08c3f5b3361f9d58b88e05a29012eaeabfd4cfa47840e6cacc812eda42",
                "md5": "9cfd4a0881b597ba8a2f503ccc463505",
                "sha256": "2eece3503a560105cbdc2dc0cef0cdf1cd31d9515089aa253c98fe7afa234fa8"
            },
            "downloads": -1,
            "filename": "cloud_tts_tool-0.0.74.tar.gz",
            "has_sig": false,
            "md5_digest": "9cfd4a0881b597ba8a2f503ccc463505",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7085,
            "upload_time": "2023-06-12T01:23:46",
            "upload_time_iso_8601": "2023-06-12T01:23:46.310295Z",
            "url": "https://files.pythonhosted.org/packages/a7/b5/dc08c3f5b3361f9d58b88e05a29012eaeabfd4cfa47840e6cacc812eda42/cloud_tts_tool-0.0.74.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-12 01:23:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cobiadigital",
    "github_project": "cloud_tts_tools",
    "github_not_found": true,
    "lcname": "cloud-tts-tool"
}
        
Elapsed time: 0.26568s