Skip to content

Commit

Permalink
chore: remove moegoe due to 没人用
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 6, 2024
1 parent 66a8ec9 commit 08d33fd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 138 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -949,14 +949,6 @@ print("run[CQ:image,file="+j["img"]+"]")

- [x] 符号说明: C5是中央C,后面不写数字,默认接5,Cb6<1,b代表降调,#代表升调,6比5高八度,<1代表音长×2,<3代表音长×8,<-1代表音长×0.5,<-3代表音长×0.125,R是休止符

</details>
<details>
<summary>日韩 VITS 模型拟声</summary>

`import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe"`

- [x] 让[派蒙|空|荧|阿贝多|枫原万叶|温迪|八重神子|纳西妲|钟离|诺艾尔|凝光|托马|北斗|莫娜|荒泷一斗|提纳里|芭芭拉|艾尔海森|雷电将军|赛诺|琴|班尼特|五郎|神里绫华|迪希雅|夜兰|辛焱|安柏|宵宫|云堇|妮露|烟绯|鹿野院平藏|凯亚|达达利亚|迪卢克|可莉|早柚|香菱|重云|刻晴|久岐忍|珊瑚宫心海|迪奥娜|戴因斯雷布|魈|神里绫人|丽莎|优菈|凯瑟琳|雷泽|菲谢尔|九条裟罗|甘雨|行秋|胡桃|迪娜泽黛|柯莱|申鹤|砂糖|萍姥姥|奥兹|罗莎莉亚|式大将|哲平|坎蒂丝|托克|留云借风真君|昆钧|塞琉斯|多莉|大肉丸|莱依拉|散兵|拉赫曼|杜拉夫|阿守|玛乔丽|纳比尔|海芭夏|九条镰治|阿娜耶|阿晃|阿扎尔|七七|博士|白术|埃洛伊|大慈树王|女士|丽塔|失落迷迭|缭乱星棘|伊甸|伏特加女孩|狂热蓝调|莉莉娅|萝莎莉娅|八重樱|八重霞|卡莲|第六夜想曲|卡萝尔|姬子|极地战刃|布洛妮娅|次生银翼|理之律者|迷城骇兔|希儿|魇夜星渊|黑希儿|帕朵菲莉丝|天元骑英|幽兰黛尔|德丽莎|月下初拥|朔夜观星|暮光骑士|明日香|李素裳|格蕾修|梅比乌斯|渡鸦|人之律者|爱莉希雅|爱衣|天穹游侠|琪亚娜|空之律者|薪炎之律者|云墨丹心|符华|识之律者|维尔薇|芽衣|雷之律者|阿波尼亚]说(中文)

</details>
<details>
<summary>摸鱼</summary>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/Baidu-AIP/golang-sdk v1.1.1
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106140713-04a12240c99c
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106152938-2a63f2f5f8ce
github.com/FloatTech/floatbox v0.0.0-20241106130736-5aea0a935024
github.com/FloatTech/gg v1.1.3
github.com/FloatTech/imgfactory v0.2.2-0.20230413152719-e101cc3606ef
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/Baidu-AIP/golang-sdk v1.1.1 h1:RQsAmgDSAkiq22I6n7XJ2t3afgzFeqjY46FGhvrx4cw=
github.com/Baidu-AIP/golang-sdk v1.1.1/go.mod h1:bXnGw7xPeKt8aF7UCELKrV6UZ/46spItONK1RQBQj1Y=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106140713-04a12240c99c h1:AxcdfANP8yzj6FTRZwVPOIZdep1NZs2t6ypzt9hd82A=
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106140713-04a12240c99c/go.mod h1:PLvoLJU+v3/44UXtixfcjVrnXeK4H9m9cRCsmXA4+l8=
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106152938-2a63f2f5f8ce h1:qdCHsbiClRabCgaqlnpnwzgCZhJLzc5jxhRgpNbe4Uc=
github.com/FloatTech/AnimeAPI v1.7.1-0.20241106152938-2a63f2f5f8ce/go.mod h1:PLvoLJU+v3/44UXtixfcjVrnXeK4H9m9cRCsmXA4+l8=
github.com/FloatTech/floatbox v0.0.0-20241106130736-5aea0a935024 h1:mrvWpiwfRklt9AyiQjKgDGJjf4YL6FZ3yC+ydbkuF2o=
github.com/FloatTech/floatbox v0.0.0-20241106130736-5aea0a935024/go.mod h1:+P3hs+Cvl10/Aj3SNE96TuBvKAXCe+XD1pKphTZyiwk=
github.com/FloatTech/gg v1.1.3 h1:+GlL02lTKsxJQr4WCuNwVxC1/eBZrCvypCIBtxuOFb4=
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/magicprompt" // magicprompt吟唱提示
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/mcfish" // 钓鱼模拟器
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/midicreate" // 简易midi音乐制作
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/moegoe" // 日韩 VITS 模型拟声
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyu" // 摸鱼
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/moyucalendar" // 摸鱼人日历
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/music" // 点歌
Expand Down
67 changes: 22 additions & 45 deletions plugin/aireply/ai_tts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/FloatTech/AnimeAPI/aireply"
"github.com/FloatTech/AnimeAPI/tts"
"github.com/FloatTech/AnimeAPI/tts/baidutts"
"github.com/FloatTech/AnimeAPI/tts/genshin"
"github.com/FloatTech/AnimeAPI/tts/lolimi"
"github.com/FloatTech/AnimeAPI/tts/ttscn"
ctrl "github.com/FloatTech/zbpctrl"
Expand Down Expand Up @@ -118,15 +117,15 @@ func (r replymode) getReplyMode(ctx *zero.Ctx) aireply.AIReply {

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

var ttsModes = func() []string {
s := append(genshin.SoundList[:], make([]string, baiduttsindex-len(genshin.SoundList))...) // 0-200
s = append(s, extrattsname...) // 201 202 ...
s := make([]string, baiduttsindex) // 0-200
s = append(s, extrattsname...) // 201 202 ...

Check failure on line 128 in plugin/aireply/ai_tts.go

View workflow job for this annotation

GitHub Actions / lint

append to slice `s` with non-zero initialized length (makezero)
return s
}()

Expand Down Expand Up @@ -169,23 +168,15 @@ func (t *ttsmode) setSoundMode(ctx *zero.Ctx, name string, character int) error
return errors.New("不支持设置语音人物" + name)
}
var index = int64(-1)

Check failure on line 170 in plugin/aireply/ai_tts.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to index (ineffassign)
for i, s := range genshin.SoundList {
if s == name {
index = int64(i + 1)
break
}
}
if index == -1 {
switch name {
case extrattsname[0]:
index = baiduttsindex
case extrattsname[1]:
index = ttscnttsindex
case extrattsname[2]:
index = lolimittsindex
default:
return errors.New("语音人物" + name + "未注册index")
}
switch name {
case extrattsname[0]:
index = baiduttsindex
case extrattsname[1]:
index = ttscnttsindex
case extrattsname[2]:
index = lolimittsindex
default:
return errors.New("语音人物" + name + "未注册index")
}
m := ctx.State["manager"].(*ctrl.Control[*zero.Ctx])
// 按原来的逻辑map存的是前16位
Expand Down Expand Up @@ -229,13 +220,7 @@ func (t *ttsmode) getSoundMode(ctx *zero.Ctx) (tts.TTS, error) {
case extrattsname[2]:
ins = lolimi.NewLolimi(int(i&0xff00) >> 8)
default: // 原神
k := .k
if k != "" {
ins = genshin.NewGenshin(int(m-1), .k)
ttsins[mode] = ins
} else {
ins = lolimi.NewLolimi(int(i&0xff00) >> 8)
}
return nil, errors.New("no such mode")
}
}
return ins, nil
Expand All @@ -258,23 +243,15 @@ func (t *ttsmode) setDefaultSoundMode(name string, character int) error {
return errors.New("不支持设置语音人物" + name)
}
index := int64(-1)

Check failure on line 245 in plugin/aireply/ai_tts.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to index (ineffassign)
for i, s := range genshin.SoundList {
if s == name {
index = int64(i + 1)
break
}
}
if index == -1 {
switch name {
case extrattsname[0]:
index = baiduttsindex
case extrattsname[1]:
index = ttscnttsindex
case extrattsname[2]:
index = lolimittsindex
default:
return errors.New("语音人物" + name + "未注册index")
}
switch name {
case extrattsname[0]:
index = baiduttsindex
case extrattsname[1]:
index = ttscnttsindex
case extrattsname[2]:
index = lolimittsindex
default:
return errors.New("语音人物" + name + "未注册index")
}
m, ok := control.Lookup("tts")
if !ok {
Expand Down
12 changes: 3 additions & 9 deletions plugin/aireply/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"strings"
"time"

"github.com/FloatTech/AnimeAPI/tts/genshin"
ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/ctxext"
Expand All @@ -26,13 +25,11 @@ func init() { // 插件主体
DisableOnDefault: true,
Brief: "人工智能语音回复",
Help: "- @Bot 任意文本(任意一句话回复)\n" +
"- 设置语音模式[原神人物/百度/TTSCN/桑帛云] 数字(百度/TTSCN说话人/桑帛云)\n" +
"- 设置默认语音模式[原神人物/百度/TTSCN/桑帛云] 数字(百度/TTSCN说话人/桑帛云)\n" +
"- 设置语音模式[百度/TTSCN/桑帛云] 数字(百度/TTSCN说话人/桑帛云)\n" +
"- 设置默认语音模式[百度/TTSCN/桑帛云] 数字(百度/TTSCN说话人/桑帛云)\n" +
"- 恢复成默认语音模式\n" +
"- 设置语音回复模式[沫沫|婧枫|青云客|小爱|ChatGPT]\n" +
"- 设置原神语音 api key xxxxxx (key请加开发群获得)\n" +
"- 设置百度语音 api id xxxxxx secret xxxxxx (请自行获得)\n" +
"当前适用的原神人物含有以下: \n" + list(genshin.SoundList[:], 5) +
"\n当前适用的TTSCN人物含有以下(以数字顺序代表): \n" + list(ttscnspeakers[:], 5),
PrivateDataFolder: "tts",
})
Expand Down Expand Up @@ -153,10 +150,7 @@ func init() { // 插件主体
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(err))
return
}
banner := genshin.TestRecord[param]
if banner == "" {
banner = genshin.TestRecord["默认"]
}
banner := "这是一段测试语音"
logrus.Debugln("[tts] banner:", banner, "get sound mode...")
// 设置验证
speaker, err := ttsmd.getSoundMode(ctx)
Expand Down
48 changes: 0 additions & 48 deletions plugin/moegoe/main.go

This file was deleted.

24 changes: 0 additions & 24 deletions plugin/moegoe/model.go

This file was deleted.

0 comments on commit 08d33fd

Please sign in to comment.