fish

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package fish is a streaming text-to-speech service backed by Fish Audio. It requests PCM output so raw audio streams straight downstream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTTS

func NewTTS(cfg Config) *tts.Base

NewTTS builds a Fish Audio TTS service.

Types

type Config

type Config struct {
	// APIKey is the Fish Audio API key. Required.
	APIKey string `validate:"required"`
	// BaseURL overrides the API base; empty uses the hosted API.
	BaseURL string
	// Model is the backend model, sent as the "model" request header; empty uses
	// a current default.
	Model string
	// ReferenceID selects a voice model (a library or cloned voice). Recommended;
	// empty uses the model's default voice.
	ReferenceID string
	// SampleRate is the PCM output rate; empty uses 24 kHz. Supported: 8000,
	// 16000, 24000, 32000, 44100.
	SampleRate int
	// Speed scales the speaking rate; nil leaves it at the default.
	Speed *float64
}

Config configures the Fish Audio TTS service.

func (Config) Validate

func (c Config) Validate() error

Validate reports whether the configuration is usable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL