speaker.go 1.3 KB

12345678910111213141516171819202122232425
  1. package model
  2. type SpeakerInfo struct {
  3. Port string `yaml:"port"`
  4. }
  5. type PlayReq struct {
  6. Url string `json:"url"` //要播放的网络音频 http/https/rtsp等⾳频地址
  7. Text string `json:"text"` //要播放的文本内容
  8. Vcn string `json:"vcn"` //发音人 xiaofeng xiaoyan
  9. Speed byte `json:"speed"` //发音速度 0-100 默认50
  10. Volume byte `json:"volume"` //音量 0-100 默认50
  11. Rdn string `json:"rdn"` //数字发音 0 数值优先, 1 完全数值, 2 完全字符串, 3 字符串优先 默认2
  12. Rcn string `json:"rcn"` //数字1 的中文发音 0:表示发⾳为yao 1:表示发音为yi 默认0
  13. Reg byte `json:"reg"` //英文发音 0:⾃动识别英语单词; 1:逐个字母发音
  14. Sync bool `json:"sync"` //true: 同步模式,语音播放完毕后再响应; false:即时响应(不等待播放完成)
  15. Queue bool `json:"queue"` //true: 队列模式,如果当前有语⾳在播放,则加到队列排队播放
  16. Loop LoopInfo `json:"loop"`
  17. }
  18. type LoopInfo struct {
  19. Duration int `json:"duration"` // 循环(重复)播放时⻓(秒)选填
  20. Times int `json:"times"` // 循环(重复)播放次数(次)选填
  21. Gap int `json:"gap"` // 循环(重复)播放中的间歇时间(秒)
  22. }