Skip to main content

TulgaTTS is an AI-based TTS library for generating speech with various voices popular in the region of Kazakhstan

Project description

TulgaTTS

TulgaTTS - A library for synthesizing text-to-speech (TTS) with various popular voices in Kazakhstan.

Installation

# Via pip (in the future)

pip install tulgatts

# For audio playback (optional):

pip install -e .[audio]

Getting Started

  1. Obtain your token:

    • ⚠️ DO NOT SHARE YOUR TOKEN! It is required to send requests from your account.

    • Open Developer Tools in your browser (usually F12).

    • Go to the Storage tab (sometimes called Application or Application Storage).

    • In the left menu, find Local Storage and select the character.ai site.

    • Find the char_token key in the list on the right.

    • Copy its value. This is your token.

    • Set the CHARACTER_AI_TOKEN environment variable or create a .env file in the project root and add CHARACTER_AI_TOKEN=your_copied_token.

  2. Use the library.

Usage Examples

You can use the library in several ways. For simple scripts, use the synchronous method; for async applications, use the async/await method.

1. The simplest usage

from tulgatts import TulgaTTS



# Create a client (default voice – Tokaev)

client = TulgaTTS(api_token="CHARACTER_AI_TOKEN", voice="Tokaev")



# 1. Speak with the default voice and save to file

client.say("This is an example created with this class")

2. Synchronous usage

import os

from tulgatts import TulgaTTS

from dotenv import load_dotenv



# Load token from .env

load_dotenv()

api_token = os.getenv("CHARACTER_AI_TOKEN")



def sync_say_usage():

    if not api_token:

        print("❌ No token!")

        return



    try:

        tts_client = TulgaTTS(api_token=api_token, voice='Tokaev')

        print(f"✅ Client ready with voice '{tts_client.voice}'.")



        tts_client.say("Synchronous example.", output_file="sync_example.mp3")

        print("🎧 File ready: sync_example.mp3")



    except Exception as e:

        print(f"⚠️ Error occurred: {e}")



if __name__ == "__main__":

    print("2. Synchronous example...")

    sync_say_usage()

    print("-" * 20)

3. Asynchronous usage

import os, asyncio

from tulgatts import TulgaTTS

from dotenv import load_dotenv



# Load token from .env

load_dotenv()

api_token = os.getenv("CHARACTER_AI_TOKEN")



async def advanced_async_say():

    if not api_token: return print("No token!")

    

    try:

        tts_client = TulgaTTS(api_token=api_token)

        print(f"Client ready with voice '{tts_client.voice}'.")

        await tts_client.say_async("Third example, part one.", voice="Tokaev", output_file="advanced_async1.mp3", play_audio=True)

    except Exception as e: print(f"Error: {e}")



if __name__ == "__main__":

    print("\n3. More advanced async example...")

    asyncio.run(advanced_async_say())

    print("All examples completed.")

Available Voices

The library comes with the following pre-configured voices:

  • Nursultan Nazarbaev

  • Tokaev

  • Pavel Durov

  • Nurlan Saburov

  • Putin

  • Skriptonit

  • Elon Musk

  • Albert E

  • Yandex Alica

  • J.A.R.V.I.S

  • Tony Stark

Note: Sometimes TulgaTTS may not synthesize your expected text. This issue is being worked on.

Special thanks to PyCharacterAI for enabling TTS with Character AI voices.

Authors

  • David Suragan (TulgaTTS)

  • Gemini AI

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tulgatts-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tulgatts-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file tulgatts-0.1.1.tar.gz.

File metadata

  • Download URL: tulgatts-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for tulgatts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 937bdf00ad650eff4cfdab24ecd4cd5c02909b8e85d5396fcae3ff270594d6cc
MD5 d75d1203be0257701aea369bf0990b5c
BLAKE2b-256 42bf55255e4e2815222a1d6d086b61cf14746c4f2c70ca0e5dbe74d222675fd1

See more details on using hashes here.

File details

Details for the file tulgatts-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tulgatts-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for tulgatts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd397f059d89352d31d73ea88ffd598910bb60eced629ad0b46fd2e3601400bb
MD5 026909de13e91bbf8be740b5aed9e12a
BLAKE2b-256 0a916f2f7b5cde4a9112bba52b50d08a9ca086ba347f062dd78045c78cd547d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page