Skip to main content

п»ї# ChatGPT-TTS Integration Library! The ChatGPT-TTS Integration Library is a powerful open-source tool that seamlessly combines the capabilities of ChatGPT and Text-to-Speech (TTS) technology. With this library, developers can effortlessly create conversational AI applications that not only understand text input but also generate natural-sounding spoken responses. This integration allows for a more immersive and interactive user experience, making it ideal for chatbots, virtual assistants, and other AI-driven applications.

Table of Contents

Getting Started

Installation

Install using pypi

pip install chatgpt-tts

or

  • Clone the GitHub repository:
     git clone https://github.com/soyll/chatgpt-tts.git	
    
  • Navigate to directory:
     cd chatgpt-tts 
    
  • (Recommended) Create a virtual environment to manage Python packages for your project:
     python3 -m venv venv
    
  • Activate the virtual enviropment
    • On windows:
       .\venv\Scripts\activate
      
    • On linux or macOs:
       source venv/bin/activate
      
  • Install the required Python packages from requirements.txt:
     pip install -r requirments.txt
    

Usage

import chatgpt-tts

# init ChatGPT-TTS
chat_tts = ChatGpt_TTS(speaker, model_id, language, folder_to_save)

# use ChatGPT-TTS
chat_tts.create_tts(text, prompt, user_id)

Models

All support modeles check in Silero Models

Integrate with Telegram

# code by bruhmnm
import telebot  
from chatgptTTS import chat  
  
TOKEN = "TELEGRAM_TOKEN"  

# init ChatGPT-TTS 
chat_tts = chat.ChatGpt_TTS("en_0", "v3_en", "en", folder="usr/audio/")  
  
bot = telebot.TeleBot(TOKEN)  
  
@bot.message_handler(content_types=['text'])  
def integrate(message):  
	audio = chat_tts.create_tts(text=message.text, prompt="prompt", id=message.from_user.id)  
	# read wav
	with open(audio[1], 'rb') as fd:  
		audio = fd.read()  
	# send voice
	bot.send_voice(message.from_user.id, audio)  
  
bot.polling(none_stop=True)

Parameters

name description example
speaker A trained vocal pattern with gender, accent, and tone en_0, en_1
model_id Unique id of the language, indicating its version en_v3, v3_ru
lang Language indicating available model_id and speaker ru, en
folder Absolute path to the folder where Chat-GPT responses will be saved C:/Example/Path/
prompt A set of words denoting a task or dialog scenario Act as an editor and correct the mistakes in this text
text Text indicating a request to Chat-Gpt to which it will later respond AI help for your creativty, no mstakes, great wrting!
id A unique number that, when integrated with social media, can be linked to an individual user for logs self.chat_id, self.user_id, id355367865, 34567653479

Metadata

Release files for chatgptTTS 1.0.0

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

Source distribution (sdist)

Source distribution for chatgptTTS 1.0.0
File Size Uploaded
chatgptTTS-1.0.0.tar.gz 5.0 kB Details

Built distribution (wheel)

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

Total release size: 9.7 kB

Release files / chatgptTTS-1.0.0.tar.gz

Download URL chatgptTTS-1.0.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a88dcb39364f39f2e1bc3501befef7e741a172a9f809c2e751c7646ddcde13d0
BLAKE2b-256 checksum
How to use checksums
d5c086149d6c662cf3518e3717bdf5191ea67caccc6660b9cb6687254f60a206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / chatgptTTS-1.0.0-py3-none-any.whl

Download URL chatgptTTS-1.0.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92a66b05e2b3f25126075b6bb5b48d0900f701459224b02fb6bc08ee43cc2b0b
BLAKE2b-256 checksum
How to use checksums
2218759f502f8263b7e3029da42effd4211e9dd238e4da3ae9e3cc4ace36f050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

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