google-tts (Google Text-to-Speech), a Python library with Google text-to-speech API
Project description
google-tts
google-tts (Google Text-to-Speech), a Python library with Google text-to-speech API. Write spoken audio data to a file, or get Base64 encoding audio data
Features
- Text length up to 5000 characters
- Customizable speak-rate (0.25 - 4.0) and sample-rate
- Audio encoding: LINEAR16, MP3, OGG-OPUS, MULAW, ALAW
- MALE and FEMALE voice
Installation
$ pip install google-tts
Quickstart
from GoogleTTS import GoogleTTS
tts = GoogleTTS()
ret = tts.tts('Xin chào!', 'output.mp3')
if 'audioContent' in ret:
b64 = ret['audioContent']
else:
error = ret['error']
code = error['code']
message = error['message']
status = error['status']
Licence
The MIT License (MIT) Copyright © 2022 ykuta
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
google-tts-1.0.1.tar.gz
(4.3 kB
view details)
File details
Details for the file google-tts-1.0.1.tar.gz.
File metadata
- Download URL: google-tts-1.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
470167ef99599fc31929e4e3e282147fb1e5fe10c7900cbcedd91542737dd1ed
|
|
| MD5 |
fa769fb1198d9ddbc927c8f448848c6a
|
|
| BLAKE2b-256 |
ca25e5083a0ab9977ceb1c2ae041ec29a519698db5de836bf9834411bba092b5
|