Documentation ¶
Index ¶
- Constants
- Variables
- type AudioConfig
- type GetTokenReq
- type GetTokenResponse
- type InvokeRequest
- type InvokeResponse
- type PhoneInfo
- type Sami
- func (p *Sami) GetAPIInfo(api string) *base.ApiInfo
- func (p *Sami) GetServiceInfo() *base.ServiceInfo
- func (p *Sami) GetToken(req GetTokenReq) (*GetTokenResponse, int, error)
- func (p *Sami) SetHost(host string)
- func (p *Sami) SetRegion(region string)
- func (p *Sami) SetSchema(schema string)
- func (p *Sami) TTS(req SpeechSynthesisReq, appkey string, token string) (*InvokeResponse, int, error)
- type SpeechSynthesisReq
- type SpeechSynthesisResponse
- type WordInfo
Constants ¶
View Source
const ( DefaultRegion = "cn-north-1" ServiceVersion20210727 = "2021-07-27" ServiceName = "sami" SamiDomain = "https://sami.bytedance.com" )
Variables ¶
View Source
var ( ServiceInfo = &base.ServiceInfo{ Timeout: 10 * time.Second, Host: "open.volcengineapi.com", Header: http.Header{}, } ApiInfoList = map[string]*base.ApiInfo{ "GetToken": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"GetToken"}, "Version": []string{ServiceVersion20210727}, }, }, } )
View Source
var DefaultInstance = NewInstance()
DefaultInstance 默认的实例
Functions ¶
This section is empty.
Types ¶
type AudioConfig ¶
type GetTokenReq ¶
type GetTokenResponse ¶
type GetTokenResponse struct { StatusCode int32 `form:"status_code,required" json:"status_code,required" query:"status_code,required"` StatusText string `form:"status_text,required" json:"status_text,required" query:"status_text,required"` TaskId string `form:"task_id,required" json:"task_id,required" query:"task_id,required"` Token string `form:"token,required" json:"token,required" query:"token,required"` ExpiresAt int64 `form:"expires_at,required" json:"expires_at,required" query:"expires_at,required"` }
type InvokeRequest ¶
type InvokeResponse ¶
type InvokeResponse struct { StatusCode int32 `form:"status_code,required" json:"status_code,required" query:"status_code,required"` StatusText string `form:"status_text,required" json:"status_text,required" query:"status_text,required"` TaskId string `form:"task_id,required" json:"task_id,required" query:"task_id,required"` Namespace string `form:"namespace,required" json:"namespace,required" query:"namespace,required"` Payload *string `form:"payload,omitempty" json:"payload,omitempty" query:"payload,omitempty"` Data []byte `form:"data,omitempty" json:"data,omitempty" query:"data,omitempty"` State *string `form:"state,omitempty" json:"state,omitempty" query:"state,omitempty"` }
type PhoneInfo ¶
type PhoneInfo struct { Phone string `json:"phone"` StartTime float32 `json:"start_time"` EndTime float32 `json:"end_time"` }
PhoneInfo includes phone information
type Sami ¶
IAM .
func (*Sami) GetServiceInfo ¶
func (p *Sami) GetServiceInfo() *base.ServiceInfo
GetServiceInfo interface
func (*Sami) GetToken ¶
func (p *Sami) GetToken(req GetTokenReq) (*GetTokenResponse, int, error)
func (*Sami) TTS ¶
func (p *Sami) TTS(req SpeechSynthesisReq, appkey string, token string) (*InvokeResponse, int, error)
type SpeechSynthesisReq ¶
type SpeechSynthesisReq struct { Text string `json:"text"` SSML string `json:"ssml"` Speaker string `json:"speaker,omitempty"` Config AudioConfig `json:"audio_config"` }
type SpeechSynthesisResponse ¶
Click to show internal directories.
Click to hide internal directories.