Implements a Magpie TTS backend in Go, loading models via C-API, synthesizing audio, and streaming WAV output.
// Source: https://github.com/mudler/LocalAI | License: MIT | Copyright 2023-2025 Ettore Di Giacinto (mudler@localai.io) // Provided via justclaw.it.com; keep this notice with the code. package main import ( "fmt" "path/filepath" "unsafe" "github.com/mudler/LocalAI/pkg/grpc/base" pb "github.com/mudler/LocalAI/pkg/grpc/proto" "github.com/mudler/xlog" ) // capiABIVersion is the magpie_tts_capi.h surface this backend binds. Bumped // upstream on any breaking signature/semantics change; refuse to run on a // mismatch instead of crashing inside a miscompiled call. const capiABIVersion = 1 var ( // magpie_tts_capi_abi_version() int CppAbiVersion func() int // magpie_tts_capi_load(gguf_path) -> ctx (NULL on failure) CppLoad func(path string) uintptr // magpie_tts_capi_free(ctx) Cp ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key