音色可配置
This commit is contained in:
@@ -16,6 +16,7 @@ aliyun:
|
||||
accessKeySecret:
|
||||
appKey:
|
||||
timeout: 10 # 单位 s
|
||||
voice: zhifeng_emo
|
||||
game:
|
||||
maxTimeout: 60 # 单位 s
|
||||
cardGroups:
|
||||
|
||||
@@ -14,6 +14,7 @@ type AliyunConfig struct {
|
||||
AccessKeySecret string
|
||||
AppKey string
|
||||
Timeout int
|
||||
Voice string
|
||||
}
|
||||
|
||||
type GameConfig struct {
|
||||
|
||||
21
game.md
21
game.md
@@ -22,13 +22,24 @@
|
||||
```json lines
|
||||
{
|
||||
// 播放文件地址,支持 file:// 本地文件地址、 http(s):// 远程文件地址
|
||||
"video": "",
|
||||
"video": ""
|
||||
}
|
||||
```
|
||||
|
||||
## 神女除妖(3)
|
||||
|
||||
除妖处不需要任何额外的处理,待游戏自然完成即可
|
||||
参照 [请求响应文档](https://www.emqx.com/zh/blog/mqtt5-request-response),
|
||||
发送附带`ResponseTopic`,并订阅`ResponseTopic`,才能接收到响应结果
|
||||
|
||||
### RequestPayload
|
||||
|
||||
```json lines
|
||||
{}
|
||||
```
|
||||
|
||||
### ResponsePayload
|
||||
|
||||
暂时还未对接除妖设备,不知道返回的数据结构是什么
|
||||
|
||||
```json lines
|
||||
{}
|
||||
@@ -36,8 +47,8 @@
|
||||
|
||||
## 神女授书(4)
|
||||
|
||||
参照 [请求响应文档](https://www.emqx.com/zh/blog/mqtt5-request-response),发送附带`ResponseTopic`,并订阅`ResponseTopic`
|
||||
,才能接收到响应结果
|
||||
参照 [请求响应文档](https://www.emqx.com/zh/blog/mqtt5-request-response),
|
||||
发送附带`ResponseTopic`,并订阅`ResponseTopic`,才能接收到响应结果
|
||||
|
||||
### RequestPayload
|
||||
|
||||
@@ -78,4 +89,4 @@
|
||||
}
|
||||
```
|
||||
|
||||
`wait_card` 为等待插卡的时长,超过时长将直接结束且没有任何现场效果。`wait` 为插卡后持续的现场效果时间。
|
||||
`wait_card` 为等待插卡的时长,超过时长将直接结束且没有任何现场效果。`wait` 为插卡后持续的现场效果时间。
|
||||
|
||||
@@ -28,6 +28,7 @@ func WaitCard(c *leaf.Context) {
|
||||
wait.Add(1)
|
||||
go func() {
|
||||
defer wait.Done()
|
||||
//TODO: 模拟卡片 3s 插入
|
||||
time.Sleep(3 * time.Second)
|
||||
a <- "卡片数据"
|
||||
}()
|
||||
|
||||
@@ -71,6 +71,7 @@ func (tts *AliTTS) getToken() error {
|
||||
func (tts *AliTTS) Get(text string) (io.Reader, error) {
|
||||
param := nls.DefaultSpeechSynthesisParam()
|
||||
param.Volume = 100
|
||||
param.Voice = tts.Voice
|
||||
|
||||
err := tts.getToken()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user