Skip to content

Commit

Permalink
fix: tts speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 27, 2023
1 parent e75814e commit f043fbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/ai_reply/ai_tts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
// 数据结构: [4 bits] [4 bits] [8 bits]
// [ttscn模式] [百度模式] [tts模式]

// [tts模式]: 0~255 genshin 256 baidu 257 ttscn
// [tts模式]: 0~200 genshin 201 baidu 202 ttscn

const (
lastgsttsindex = 255 + iota
lastgsttsindex = 200 + iota
baiduttsindex
ttscnttsindex
)
Expand Down Expand Up @@ -111,16 +111,16 @@ func (r replymode) getReplyMode(ctx *zero.Ctx) aireply.AIReply {
}

var ttsins = func() map[string]tts.TTS {
m := make(map[string]tts.TTS, 128)
m := make(map[string]tts.TTS, 512)
for _, mode := range append(genshin.SoundList[:], extrattsname...) {
m[mode] = nil
}
return m
}()

var ttsModes = func() []string {
s := append(genshin.SoundList[:], make([]string, lastgsttsindex-len(genshin.SoundList))...) // 0-255
s = append(s, extrattsname...) // 256 257 ...
s := append(genshin.SoundList[:], make([]string, lastgsttsindex-len(genshin.SoundList))...) // 0-200
s = append(s, extrattsname...) // 201 202 ...
return s
}()

Expand Down

0 comments on commit f043fbf

Please sign in to comment.