Skip to main content

Respeecher TTS plugin for LiveKit Agents.

Project description

Respeecher LiveKit Plugin

Respeecher TTS integration for LiveKit Agents.

This package is maintained by Respeecher. It uses the normal LiveKit plugin import path, but it is distributed outside the LiveKit monorepo while the upstream PR is under review.

Installation

pip install livekit-agents livekit-plugins-respeecher

Configure

export LIVEKIT_URL="wss://..."
export LIVEKIT_API_KEY="..."
export LIVEKIT_API_SECRET="..."
export RESPEECHER_API_KEY="..."

RESPEECHER_API_KEY is used when api_key is not passed to the constructor; you can also pass it directly: respeecher.TTS(api_key="...", voice_id="...").

Usage

from dotenv import load_dotenv

from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli
from livekit.plugins import respeecher

load_dotenv()


async def entrypoint(ctx: JobContext) -> None:
    await ctx.connect()

    session = AgentSession(
        tts=respeecher.TTS(voice_id="marta"),
    )

    await session.start(
        room=ctx.room,
        agent=Agent(instructions="You are a concise voice assistant."),
    )


if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))

voice_id is required because each Respeecher model exposes its own voice list. The plugin streams over WebSocket by default; chunked HTTP synthesis is also available via TTS.synthesize(text).

Discover Voices

import asyncio

from livekit.plugins import respeecher


async def main() -> None:
    tts = respeecher.TTS(voice_id="placeholder")
    voices = await tts.list_voices()
    for voice in voices:
        print(voice.id)


asyncio.run(main())

Use a voice_id returned by list_voices() for the model you plan to use.

Overriding Sampling Parameters

See the Sampling Parameters Guide.

from livekit.plugins import respeecher

tts = respeecher.TTS(
    voice_id="marta",
    voice_settings=respeecher.VoiceSettings(
        sampling_params={
            "min_p": 0.01,
        },
    ),
)

Models

See Models & Languages. Supported models:

  • /public/tts/en-rt (default)
  • /public/tts/ua-rt

To use the Ukrainian model, pass it explicitly:

from livekit.plugins import respeecher

tts = respeecher.TTS(
    voice_id="olesia-conversation",
    model="/public/tts/ua-rt",
)

Compatibility

Requires livekit-agents>=1.5,<2.

Support

For plugin issues, open an issue in this repository; for LiveKit Agents itself, use the LiveKit repo. If this plugin helps your use case, feedback on the upstream PR is appreciated.

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

livekit_plugins_respeecher-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

livekit_plugins_respeecher-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_respeecher-0.1.0.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_respeecher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d0185fafc0d2017add98ba6d90ad8a83d524b14d0c9698e52ec316c110204ae5
MD5 f66959991fb554851156e5f97a1b58f0
BLAKE2b-256 736c3bd14eeff9f5efddc94ce17ea6dea1db98132f8fe530b79c2ec88acbad1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_respeecher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aba96de2b2b8d0b2058dfd8d69735f4ffe3fe8f3333870c83ef91702ac68817c
MD5 84f3d4770484ba85d363d54d6c75e2e4
BLAKE2b-256 869b3e1be11967e537f9885bcd59d8ef36243cab320566431f1b05aa5d6ff68f

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