Skip to main content

TTS extension for multiai using OpenAI and Google GenAI

Project description

multiai-tts

multiai-tts is an extension library for multiai that provides Text-to-Speech (TTS) capabilities using OpenAI and Google GenAI.

Prerequisites

API Key Configuration

This library relies on the configuration provided by multiai. You must set up your API keys (OpenAI API Key, Google API Key) using multiai's configuration files or environment variables before using this library.

For details on how to configure API keys, please refer to the multiai documentation.

Installation

You also need to install ffmpeg on your system if you want to save audio in formats other than WAV (e.g., MP3).

pip install multiai-tts

Usage

Google GenAI Example

import sys
import multiai_tts

provider = 'google'
model = 'gemini-2.5-flash-preview-tts'

client = multiai_tts.Prompt()
client.set_tts_model(provider, model)
client.tts_voice_google = 'charon'

# Speak directly
client.speak("Please speak the following. Hello, this is a test from Google model.")
if client.error:
    print(client.error_message)
    sys.exit(1)

# Save to file
client.save_tts("Please speak the following. Saving this audio to mp3.", "output_google.mp3")
if client.error:
    print(client.error_message)
    sys.exit(1)

OpenAI Example

import sys
import multiai_tts

provider = 'openai'
model = 'gpt-4o-mini-tts'

client = multiai_tts.Prompt()
client.set_tts_model(provider, model)
client.tts_voice_openai = 'marin'

# Speak directly
client.speak("Hello, this is a test from OpenAI model.")
if client.error:
    print(client.error_message)
    sys.exit(1)

# Save to file
client.save_tts("Saving this audio to mp3.", "output_openai.mp3")
if client.error:
    print(client.error_message)
    sys.exit(1)

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

multiai_tts-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

multiai_tts-0.1.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for multiai_tts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9688b2ab26a47fd3a16380ddb4228aa78fa2d4dfd738424375cc718f31b2b645
MD5 c6c142c40446146cdf20ae72551462d0
BLAKE2b-256 24da344d3ddd5cf0ff64c0d2c96ddc38853bc8e41f6c4c1efe2ce0871144aff6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for multiai_tts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90afd273bff420fefff0a5ff883cdaa4986c554aa144cfc108214333ccb0bd15
MD5 32f870b7481a6d496d0b652a10a3f460
BLAKE2b-256 84732ea423d3758ce483bfd076a3e641e3ebe23d165c282c0796d1fcef6e5f55

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