tts

package
v1.777.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlibabacloudTextToSpeechProvider

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

func NewAlibabacloudTextToSpeechProvider

func NewAlibabacloudTextToSpeechProvider(typ string, subType string, secretKey string, voice string) (*AlibabacloudTextToSpeechProvider, error)

func (*AlibabacloudTextToSpeechProvider) GetPricing

func (p *AlibabacloudTextToSpeechProvider) GetPricing() string

func (*AlibabacloudTextToSpeechProvider) QueryAudio

func (*AlibabacloudTextToSpeechProvider) QueryAudioStream

func (p *AlibabacloudTextToSpeechProvider) QueryAudioStream(text string, ctx context.Context, writer io.Writer, lang string) (*TextToSpeechResult, error)

type TextToSpeechProvider

type TextToSpeechProvider interface {
	GetPricing() string
	QueryAudio(text string, ctx context.Context, lang string) ([]byte, *TextToSpeechResult, error)
	QueryAudioStream(text string, ctx context.Context, writer io.Writer, lang string) (*TextToSpeechResult, error)
}

func GetTextToSpeechProvider

func GetTextToSpeechProvider(typ string, subType string, clientId string, clientSecret string, providerUrl string, apiVersion string, pricePerThousandChars float64, currency string, flavor string, lang string) (TextToSpeechProvider, error)

type TextToSpeechResult

type TextToSpeechResult struct {
	TokenCount int
	Price      float64
	Currency   string
}

Jump to

Keyboard shortcuts

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