Documentation
¶
Overview ¶
Package tts provides OmniVoice-based text-to-speech for marp2video.
Index ¶
- func VoiceConfigToSynthesisConfig(voice transcript.VoiceConfig) omnivoice.SynthesisConfig
- type Factory
- type Provider
- func (p *Provider) Name() string
- func (p *Provider) Synthesize(ctx context.Context, text string, voice transcript.VoiceConfig) ([]byte, error)
- func (p *Provider) SynthesizeWithDuration(ctx context.Context, text string, voice transcript.VoiceConfig) ([]byte, time.Duration, error)
- func (p *Provider) UnderlyingProvider() omnivoice.TTSProvider
- type ProviderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VoiceConfigToSynthesisConfig ¶
func VoiceConfigToSynthesisConfig(voice transcript.VoiceConfig) omnivoice.SynthesisConfig
VoiceConfigToSynthesisConfig converts marp2video VoiceConfig to OmniVoice SynthesisConfig.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory creates TTS providers based on configuration.
func NewFactory ¶
func NewFactory(config ProviderConfig) *Factory
NewFactory creates a new TTS provider factory.
func (*Factory) Available ¶
Available returns a list of available provider names based on configured API keys.
func (*Factory) Get ¶
Get returns a provider by name, creating it if necessary. If name is empty, returns the fallback provider.
func (*Factory) SetFallback ¶
SetFallback sets the default provider name.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider wraps an OmniVoice TTS provider for use with marp2video.
func New ¶
func New(provider omnivoice.TTSProvider) *Provider
New creates a new OmniVoice TTS provider wrapper.
func (*Provider) Synthesize ¶
func (p *Provider) Synthesize(ctx context.Context, text string, voice transcript.VoiceConfig) ([]byte, error)
Synthesize converts text to speech using the OmniVoice provider.
func (*Provider) SynthesizeWithDuration ¶
func (p *Provider) SynthesizeWithDuration(ctx context.Context, text string, voice transcript.VoiceConfig) ([]byte, time.Duration, error)
SynthesizeWithDuration converts text to speech and returns audio with duration.
func (*Provider) UnderlyingProvider ¶
func (p *Provider) UnderlyingProvider() omnivoice.TTSProvider
UnderlyingProvider returns the wrapped OmniVoice provider for advanced operations.
type ProviderConfig ¶
type ProviderConfig struct {
// ElevenLabsAPIKey is the API key for ElevenLabs.
ElevenLabsAPIKey string
// DeepgramAPIKey is the API key for Deepgram.
DeepgramAPIKey string
}
ProviderConfig holds configuration for creating TTS providers.