music

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VeniceModels = []string{
		"ace-step-15",
		"elevenlabs-music",
		"minimax-music-v2",
		"minimax-music-v25",
		"minimax-music-v26",
		"stable-audio-25",
		"elevenlabs-sound-effects-v2",
		"mmaudio-v2-text-to-audio",
		"elevenlabs-tts-v3",
		"elevenlabs-tts-multilingual-v2",
	}
	VeniceFormats     = []string{"mp3", "wav", "flac"}
	VeniceVoices      = []string{"Aria", "Roger", "Sarah", "Laura", "Charlie", "George", "Callum", "River", "Liam", "Charlotte", "Alice", "Matilda", "Will", "Jessica", "Eric", "Chris", "Brian", "Daniel", "Lily", "Bill"}
	ElevenLabsModels  = []string{"music_v1"}
	ElevenLabsFormats = []string{
		"alaw_8000",
		"mp3_22050_32", "mp3_24000_48", "mp3_44100_32", "mp3_44100_64", "mp3_44100_96", "mp3_44100_128", "mp3_44100_192",
		"opus_48000_32", "opus_48000_64", "opus_48000_96", "opus_48000_128", "opus_48000_192",
		"pcm_8000", "pcm_16000", "pcm_22050", "pcm_24000", "pcm_32000", "pcm_44100", "pcm_48000",
		"ulaw_8000",
		"wav_8000", "wav_16000", "wav_22050", "wav_24000", "wav_32000", "wav_44100", "wav_48000",
	}
)

Functions

func ExtensionForFormat

func ExtensionForFormat(format string) string

func Save

func Save(data []byte, outputDir, prompt, format string) (string, error)

func ValidateElevenLabsFormat

func ValidateElevenLabsFormat(format string) error

func ValidateVeniceFormat

func ValidateVeniceFormat(format string) error

func VeniceDefaultFormatForModel

func VeniceDefaultFormatForModel(model string) string

Types

type ElevenLabsProvider

type ElevenLabsProvider struct {
	// contains filtered or unexported fields
}

func NewElevenLabsProvider

func NewElevenLabsProvider(apiKey string) *ElevenLabsProvider

func (*ElevenLabsProvider) Generate

func (p *ElevenLabsProvider) Generate(ctx context.Context, req Request) (*Result, error)

type Request

type Request struct {
	Prompt                      string
	CompositionPlan             json.RawMessage
	Model                       string
	Format                      string
	DurationSeconds             int
	Seed                        string
	ForceInstrumental           bool
	ForceInstrumentalSet        bool
	LyricsPrompt                string
	LyricsOptimizer             bool
	LyricsOptimizerSet          bool
	Voice                       string
	LanguageCode                string
	Speed                       float64
	Streaming                   bool
	Detailed                    bool
	WithTimestamps              bool
	RespectSectionsDurations    bool
	RespectSectionsDurationsSet bool
	StoreForInpainting          bool
	SignWithC2PA                bool
	DeleteMediaOnCompletion     bool
	QuoteOnly                   bool
	PollInterval                time.Duration
	PollTimeout                 time.Duration
	Debug                       bool
	DebugRaw                    bool
}

type Result

type Result struct {
	Data     []byte
	MimeType string
	Format   string
	Quote    *float64
	Metadata json.RawMessage
}

type VeniceProvider

type VeniceProvider struct {
	// contains filtered or unexported fields
}

func NewVeniceProvider

func NewVeniceProvider(apiKey string) *VeniceProvider

func (*VeniceProvider) Generate

func (p *VeniceProvider) Generate(ctx context.Context, req Request) (*Result, error)

Jump to

Keyboard shortcuts

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