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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WssURL    = "wss://speech.platform.bing.com/consumer/speech/synthesize/" + "readaloud/edge/v1?TrustedClientToken=" + trustedClientToken
	VoiceList = "https://speech.platform.bing.com/consumer/speech/synthesize/" + "readaloud/voices/list?trustedclienttoken=" + trustedClientToken
)

Variables

This section is empty.

Functions

func GetProxyByOption

func GetProxyByOption(opts []Option) string

func GetRateByOption

func GetRateByOption(opts []Option) string

func GetVoiceByOption

func GetVoiceByOption(opts []Option) string

func GetVolumeByOption

func GetVolumeByOption(opts []Option) string

func PrintVoices

func PrintVoices(proxy string)

Types

type AudioData

type AudioData struct {
	Data  []byte
	Index int
}

type Communicate

type Communicate struct {
	Text            string
	Voice           string
	VoiceLangRegion string
	Rate            string
	Volume          string
	Proxy           string

	AudioDataIndex int
	// contains filtered or unexported fields
}

func NewCommunicate

func NewCommunicate(text string, opts ...Option) (*Communicate, error)

func (*Communicate) CloseOutput

func (c *Communicate) CloseOutput()

func (*Communicate) Stream

func (c *Communicate) Stream() (<-chan map[string]interface{}, error)

type NoAudioReceived

type NoAudioReceived struct {
	Message string
}

type Option

type Option struct {
	OptID optionID
	Param string
}

func WithProxy

func WithProxy(voice string) Option

func WithRate

func WithRate(voice string) Option

func WithVolume

func WithVolume(voice string) Option

type UnexpectedResponse

type UnexpectedResponse struct {
	Message string
}

type UnknownResponse

type UnknownResponse struct {
	Message string
}

type WebSocketError

type WebSocketError struct {
	Message string
}

Jump to

Keyboard shortcuts

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