Xiaoai speaker customizes the text to read aloud.
go get xxxxxxx
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)
- Add .env on the root dir
echo "User=xx\nPwd=xxx"> .env
- Up it
docker-compose -f docker-compose.yml up
- Test it
curl --location 'http://127.0.0.1:8848/xiaoai/speak' \
--form 'msg="a"'