tts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TTS

func TTS(f TTSMode, input, writeMedia, voice, rate, volume, proxy string)

func TTSFile

func TTSFile(file, writeMedia string, opts ...tts.Option)

func TTSPlayback

func TTSPlayback(f TTSMode, input, writeMedia, voice, rate, volume, proxy string, callback func(string))

func TTSText

func TTSText(text, writeMedia string, opts ...tts.Option)

Types

type ISpeech

type ISpeech interface {
	GenTTS() error
	URL(filename string) (string, error)
}

type LocalSpeech

type LocalSpeech struct {
	*Speech
}
var MySpeech *LocalSpeech

func NewLocalSpeech

func NewLocalSpeech(c *tts.Communicate, folder, filename string) (*LocalSpeech, error)

func (*LocalSpeech) GenTTS

func (speech *LocalSpeech) GenTTS() error

func (*LocalSpeech) URL

func (speech *LocalSpeech) URL(filename string) (string, error)

type OssSpeech

type OssSpeech struct {
	*Speech
	// contains filtered or unexported fields
}

func NewOssSpeech

func NewOssSpeech(c *tts.Communicate, endpoint, ak, sk, folder, bucket string) (*OssSpeech, error)

func (*OssSpeech) GenTTS

func (speech *OssSpeech) GenTTS() error

func (*OssSpeech) URL

func (speech *OssSpeech) URL(filename string) (string, error)

type OssSpeechFactory

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

func NewOssSpeechFactory

func NewOssSpeechFactory(endpoint, ak, sk, bucket, folder string) *OssSpeechFactory

func (*OssSpeechFactory) OssSpeech

func (factory *OssSpeechFactory) OssSpeech(c *tts.Communicate, folder string) (*OssSpeech, error)

type Speech

type Speech struct {
	*tts.Communicate
	storage.IStorage
	Folder   string
	FileName string
}

func NewSpeech

func NewSpeech(c *tts.Communicate, storage storage.IStorage, folder, filename string) (*Speech, error)

type TTSMode

type TTSMode int
const (
	TEXT TTSMode = 0
	FILE TTSMode = 1
)

Jump to

Keyboard shortcuts

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