Documentation ¶
Overview ¶
from:https://github.com/surfaceyu/edge-tts-go/blob/main/edgeTTS/communicate.go
Index ¶
- Constants
- func ParseVersion() (int, int, int)
- type Communicate
- func (c *Communicate) AllocateTask(tasks []*CommunicateTextTask)
- func (c *Communicate) Close()
- func (c *Communicate) CreatePool()
- func (c *Communicate) FillOption(text *CommunicateTextOption)
- func (c *Communicate) GetOption() CommunicateTextOption
- func (c *Communicate) OpenWs() *websocket.Conn
- func (c *Communicate) WithProxy(proxy string) *Communicate
- func (c *Communicate) WithRate(rate string) *Communicate
- func (c *Communicate) WithVoice(voice string) *Communicate
- func (c *Communicate) WithVolume(volume string) *Communicate
- type CommunicateTextOption
- type CommunicateTextTask
- type ListVoices
- type NoAudioReceivedError
- type UnexpectedResponseError
- type UnknownResponseError
- type Voice
- type WebSocketError
Constants ¶
View Source
const ( TRUSTED_CLIENT_TOKEN = "6A5AA1D4EAFF4E9FB37E23D68491D6F4" WSS_URL = "wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=" + TRUSTED_CLIENT_TOKEN VOICE_LIST = "https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=" + TRUSTED_CLIENT_TOKEN )
View Source
const ( ZhCN = "zh-CN" EnUS = "en-US" )
Locale
View Source
const ( ChunkTypeAudio = "Audio" ChunkTypeWordBoundary = "WordBoundary" ChunkTypeSessionEnd = "SessionEnd" ChunkTypeEnd = "ChunkEnd" )
View Source
const Version = "1.0.1"
Version is the Edge TTS version string.
Variables ¶
This section is empty.
Functions ¶
func ParseVersion ¶
ParseVersion parses the version string and returns a tuple of integers.
Types ¶
type Communicate ¶
type Communicate struct {
// contains filtered or unexported fields
}
func NewCommunicate ¶
func NewCommunicate() *Communicate
func (*Communicate) AllocateTask ¶
func (c *Communicate) AllocateTask(tasks []*CommunicateTextTask)
func (*Communicate) Close ¶
func (c *Communicate) Close()
func (*Communicate) CreatePool ¶
func (c *Communicate) CreatePool()
func (*Communicate) FillOption ¶
func (c *Communicate) FillOption(text *CommunicateTextOption)
func (*Communicate) GetOption ¶
func (c *Communicate) GetOption() CommunicateTextOption
func (*Communicate) OpenWs ¶
func (c *Communicate) OpenWs() *websocket.Conn
func (*Communicate) WithProxy ¶
func (c *Communicate) WithProxy(proxy string) *Communicate
func (*Communicate) WithRate ¶
func (c *Communicate) WithRate(rate string) *Communicate
func (*Communicate) WithVoice ¶
func (c *Communicate) WithVoice(voice string) *Communicate
func (*Communicate) WithVolume ¶
func (c *Communicate) WithVolume(volume string) *Communicate
type CommunicateTextOption ¶
type CommunicateTextOption struct {
// contains filtered or unexported fields
}
type CommunicateTextTask ¶
type CommunicateTextTask struct { Id int Text string Option CommunicateTextOption Chunk chan communicateChunk SpeechData []byte }
type ListVoices ¶
func NewListVoices ¶
func NewListVoices(proxy string) (*ListVoices, error)
func (*ListVoices) Find ¶
func (l *ListVoices) Find(gender, language string) []Voice
find Gender="Male/Female", Language="es"
type NoAudioReceivedError ¶
type NoAudioReceivedError struct {
Message string
}
NoAudioReceivedError is raised when no audio is received from the server.
func (*NoAudioReceivedError) Error ¶
func (e *NoAudioReceivedError) Error() string
type UnexpectedResponseError ¶
type UnexpectedResponseError struct {
Message string
}
UnexpectedResponseError is raised when an unexpected response is received from the server.
func (*UnexpectedResponseError) Error ¶
func (e *UnexpectedResponseError) Error() string
type UnknownResponseError ¶
type UnknownResponseError struct {
Message string
}
UnknownResponseError is raised when an unknown response is received from the server.
func (*UnknownResponseError) Error ¶
func (e *UnknownResponseError) Error() string
type WebSocketError ¶
type WebSocketError struct {
Message string
}
WebSocketError is raised when a WebSocket error occurs.
func (*WebSocketError) Error ¶
func (e *WebSocketError) Error() string
Click to show internal directories.
Click to hide internal directories.