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