Documentation
¶
Overview ¶
Package fishaudio adapts the self-hosted Fish Speech HTTP server to the stable OpenRealtime streaming speech interface.
Fish selects the base model when its server starts. The request therefore contains synthesis controls and optional voice references, but deliberately does not invent a per-request model field.
Index ¶
Constants ¶
const ( // DefaultEndpoint is where tools/fish15 serves Fish Speech 1.5. DefaultEndpoint = "http://127.0.0.1:8123/v1/tts" // DefaultModel records the server-side checkpoint. The native request has // no model selector, so this only names what the endpoint is serving. DefaultModel = "fishaudio/fish-speech-1.5" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is safe for concurrent calls. Fish server-side scheduling determines actual concurrency; each Stream call owns independent request state.
func (*Adapter) Descriptor ¶
func (adapter *Adapter) Descriptor() v1.Descriptor
Descriptor implements api/v1.SpeechProvider.
func (*Adapter) Stream ¶
func (adapter *Adapter) Stream(ctx context.Context, plan v1.SpeechPlan, consume func(v1.SpeechChunk) error) error
Stream implements api/v1.StreamingSpeechProvider. It forwards output as 24 kHz PCM16LE by default, suitable for the existing OpenAI Realtime media boundary. Only the last sample is retained to mark the terminal chunk, so streaming adds less than one output-sample period of buffering.
func (*Adapter) Synthesize ¶
func (adapter *Adapter) Synthesize(ctx context.Context, plan v1.SpeechPlan) ([]v1.SpeechChunk, error)
Synthesize collects Stream output for consumers that require the non-streaming stable interface. MaxAudioBytes bounds the retained result.
type Config ¶
type Config struct {
Endpoint string
Model string
BearerToken string
Headers http.Header
HTTPClient *http.Client
RequestTimeout time.Duration
ServerSampleRateHz uint32
OutputSampleRateHz uint32
ReferenceID string
References []Reference
UseMemoryCache bool
DisableNormalization bool
Seed *int64
ChunkLength int
MaxNewTokens int
TopP float64
RepetitionPenalty float64
Temperature float64
ReadBufferBytes int
MaxAudioBytes int64
}
Config configures a Fish Speech client. ServerSampleRateHz is used for the raw streaming contract employed by the official client; if a server emits a WAV header, its declared rate is validated and used instead.