Skip to main content

ElevenLabs plugin for GetStream

Project description

ElevenLabs Text-to-Speech Plugin

A high-quality Text-to-Speech (TTS) plugin for GetStream that uses the ElevenLabs API.

Installation

pip install getstream-plugins-elevenlabs

Usage

from getstream.plugins.elevenlabs import ElevenLabsTTS
from getstream.video.rtc.audio_track import AudioStreamTrack

# Initialize with API key from environment variable
tts = ElevenLabsTTS()

# Or specify API key directly
tts = ElevenLabsTTS(api_key="your_elevenlabs_api_key")

# Create an audio track to output speech
track = AudioStreamTrack(framerate=16000)
tts.set_output_track(track)

# Register event handlers
@tts.on("audio")
def on_audio(audio_data, user):
    print(f"Received audio chunk: {len(audio_data)} bytes")

# Send text to be converted to speech
await tts.send("Hello, this is a test of the ElevenLabs text-to-speech plugin.")

Configuration Options

  • api_key: ElevenLabs API key (default: reads from ELEVENLABS_API_KEY environment variable)
  • voice_id: The voice ID to use for synthesis (default: "VR6AewLTigWG4xSOukaG")
  • model_id: The model ID to use for synthesis (default: "eleven_multilingual_v2")

Requirements

  • Python 3.10+
  • elevenlabs>=0.2.0

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

getstream_plugins_elevenlabs-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file getstream_plugins_elevenlabs-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for getstream_plugins_elevenlabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4b94bf43dd9d1a2e374a3662a38c2a79db43a8b88d41ef28c7050597a3272eb
MD5 e98dedcd1fe1c69d6fa969eef5f808e0
BLAKE2b-256 2c0158ce9ca0acbb81a80b92edea0fc1108e82ddcee49828e5e4d26bc621c661

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