/xiaoai-tts

Xiao ai TTS API Tools

Primary LanguageGoMIT LicenseMIT

xiaoai-tts

Xiaoai speaker customizes the text to read aloud.

安装

go get xxxxxxx

Example

m := &models.MiAccount{
		User: "xxxx",
		Pwd:  "xxxx",
	}
//new a xioaxi client
xiaoai := service.NewXiaoAi(m)
//
xiaoai.Say("hello")
//
xiaoai.GetDevice() []models.DeviceInfo
//
xiaoai.UseDevice(index int16)
//
xiaoai.Say(text string)
//
xiaoai.SetVolume(volume int8)
//
xiaoai.GetVolume() string
//
xiaoai.Play()
//
xiaoai.Pause()
//
xiaoai.Prev()
//
xiaoai.Next()
//
xiaoai.TogglePlayState()
//
xiaoai.GetStatus() *models.Info
//
xiaoai.PlayUrl(url string)

Docker

  1. Add .env on the root dir
echo "User=xx\nPwd=xxx"> .env
  1. Up it
docker-compose -f docker-compose.yml up
  1. Test it
curl --location 'http://127.0.0.1:8848/xiaoai/speak' \
--form 'msg="a"'