Skip to main content

asyncgTTS

Asynchronous interfaces to the official Google Text to Speech or easygTTS APIs written with aiohttp.

Examples

asyncgTTS

import asyncio
from subprocess import PIPE, run

import aiohttp
import asyncgTTS

async def main():
    async with aiohttp.ClientSession() as session:
        gtts = await asyncgTTS.setup(premium=True, session=session, service_account_json_location="SERVICE_ACCOUNT.json")

        hello_world_ogg = await gtts.get("Hello World", voice_lang=("en-US-Standard-B", "en-us"))
        hello_world_mp3 = await gtts.get("Hello World", voice_lang=("en-US-Standard-A", "en-us"), ret_type="MP3")

    with open("Hello_world.ogg", "wb") as f:
        f.write(hello_world_ogg)
    with open("Hello_world.mp3", "wb") as f:
        f.write(hello_world_mp3)

asyncio.run(main())

easygTTS

import asyncio

import aiohttp
import asyncgTTS

async def main():
    async with aiohttp.ClientSession() as session:
        gtts = await asyncgTTS.setup(premium=False, session=session)
        hello_world = await gtts.get(text="Hello World")

    with open("Hello_world.mp3", "wb") as f:
        f.write(hello_world)

asyncio.run(main())

Metadata

Release files for asyncgTTS 0.3.1

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

Source distribution (sdist)

Source distribution for asyncgTTS 0.3.1
File Size Uploaded
asyncgTTS-0.3.1.tar.gz 5.5 kB Details

Built distribution (wheel)

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

Total release size: 12.4 kB

Release files / asyncgTTS-0.3.1.tar.gz

Download URL asyncgTTS-0.3.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99c5d6811eddee60dbe336e6e0def319f02bcb7f13c6b9c5549fec933e3c8926
BLAKE2b-256 checksum
How to use checksums
ac300a9ad8b60bb1d5a78fff96237f95ccd7fc7c227f657a9ad773b65262a8d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / asyncgTTS-0.3.1-py3-none-any.whl

Download URL asyncgTTS-0.3.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b898d47fdee08874d52f7fdde5753ee36ad964dc4a7266a9c7e98d18eece8335
BLAKE2b-256 checksum
How to use checksums
8ddbddd647da5b63c440b5ff14a9ce3166aacf77ab1ea130a5981aab749ce696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.1.0

2 release files

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