TTSv2 (deepgram/tts_v2.py)

livekit/agents · livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/tts_v2.py · python · Apache-2.0
voice, Voice / Speech

Deepgram Flux v2 TTS client offering streaming and batch synthesis with configurable model, encoding, sample rate, speed, and optional API key.

# Source: https://github.com/livekit/agents | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import asyncio
import json
import os
import weakref
from dataclasses import dataclass, replace

import aiohttp

from livekit.agents import (
    APIConnectionError,
    APIConnectOptions,
    APIError,
    APIStatusError,
    APITimeoutError,
    tokenize,
    tts,
    utils,
)
from livekit.agents.types import (
    DEFAULT_API_CONNECT_OPTIONS,
    NOT_GIVEN,
    NotGivenOr,
)
from livekit.agents.utils import is_given

from ._utils import _to_deepgram_url
from .log import logger
from .models import FluxTTSModels

# Flux TTS is served on the /v2/speak endpo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key