TTS (tts/fish_audio.py)

Patter · libraries/python/getpatter/tts/fish_audio.py · python · MIT
voice, Voice / Speech

Fish Audio TTS for Patter pipeline mode (Beta).

# Source: https://github.com/PatterAI/Patter | License: MIT | Copyright 2026 Patter Contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Fish Audio TTS for Patter pipeline mode (Beta)."""

from __future__ import annotations

import os
from typing import Any, ClassVar, Optional, Sequence, Union

from getpatter.providers.fish_audio_tts import (
    FISH_AUDIO_DEFAULT_SAMPLE_RATE,
    FishAudioTTS as _FishAudioTTS,
)
from getpatter.providers.fish_audio_ws_tts import (
    FishAudioWebSocketTTS as _FishAudioWebSocketTTS,
)

__all__ = ["TTS", "WebSocketTTS"]


def _resolve_api_key(api_key: str | None) -> str:
    key = api_key or os.environ.get("FISH_AUDIO_API_KEY")
    if not key:
        raise ValueError(
            "Fish Audio TTS requires an api_key. Pass api_key

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

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

Get a free API key