Giter Site home page Giter Site logo

mihoyovoice's Introduction

miHoYoVoice插件使用教程

很高兴,QChatGPT开始了全新的3.x版本,带给开发和用户更好的体验,这应该是QChatGPT 3.x版本的第一个语音插件,由于原神和星铁的受众广泛,所以我开发了这个插件

但是我没学过python,代码大量依赖于AI生成,难免有不合理不正确之处,反正代码和人有一个能跑就行😋

介绍

本插件调用了TTS-Online原神免费文本转语音的接口,用于将QChatGPT返回的内容转换为原神/星铁角色语音

特点:速度快,低价,效果好

使用

简单方法:管理员在聊天会话中,发送:!plugin get https://github.com/the-lazy-me/miHoYoVoice.git

下载

克隆此项目,放到plugins的文件夹下

git clone https://github.com/the-lazy-me/miHoYoVoice.git

或下载源码压缩包,解压后放到plugins的文件夹下

打开miHoYoVoice文件夹,命令行执行

pip install -r requirements.txt

速度太慢可以执行

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

token获取

打开此页面https://www.ttson.cn/

点击升级专业版

付款后,会给出一个链接(只展示一次,相当重要,记清楚,不然钱就白花了!!!

这个链接形如https://acgn.ttson.cn/?token=一串英文数字字符

这个token=后面的英文数字字符就是获取到的token,复制备用

是等于号后面的!!!不是那一串网址!!!长眼睛看清楚!!!

配置

打开miHoYoVoice的config文件夹下的config.yaml,内容如下所示

# 默认角色,可在对话中指定角色,不指定则使用默认角色
character: "派蒙"
# 是否默认开启语音功能,默认为False,即不开启,True为默认开启,看你喜好
voice_switch: True

# token,这个是必须的,不然无法使用,可以配置多个token,获取方式请看文档
token:
  - "填入你的token 1"

重点关注第三个,token,在汉字提示处填入刚刚复制的token,保存即可

指令

对话中,发送

  • !语音合成 开启
  • !语音合成 关闭
  • !语音合成 状态
  • !语音合成 角色列表
  • !语音合成 角色切换 <角色名> 举个例子:!语音合成 角色切换 纳西妲
  • !语音合成 帮助

mihoyovoice's People

Contributors

the-lazy-me avatar

Stargazers

Junyan Qin avatar WangCham avatar  avatar

Watchers

 avatar

mihoyovoice's Issues

断断续续

偶尔使用语音回复,偶尔不使用。原因是gpt给出了一些不能用语音表达的字符。

qchat docker部署配合napcat使用语音报错

我在文件目录中发现音频文件都已经生成了,但是貌似在路径上有问题?我printf了一下发现路径应该是没问题的,不知道具体是哪里有问题。

完整报错内容
[2024-06-10 16:19:16.076] /app/plugins/miHoYoVoice/main.py (112) - [INFO] :

使用角色“派蒙”生成回复语音

/app/plugins/miHoYoVoice/audio_temp/677c820e.silk

[2024-06-10 16:19:17.565] /app/pkg/pipeline/controller.py (152) - [ERROR] :

处理请求时出错 query_id=1: <ActionFailed status='failed', retcode=1200, data=None, message='Error: 文件下载失败uri /app/plugins/miHoYoVoice/audio_temp/677c820e.silk 解析失败,TypeError [ERR_INVALID_URL]: Invalid URL 可能/app/plugins/miHoYoVoice/audio_temp/677c820e.silk不存在\n    at Object.fQxoR (file:///usr/src/app/napcat/napcat.mjs:21431:6629)\n    at handleOb11FileLikeMessage (file:///usr/src/app/napcat/napcat.mjs:21431:10914)\n    at async Object.record (file:///usr/src/app/napcat/napcat.mjs:21431:14373)\n    at async createSendElements (file:///usr/src/app/napcat/napcat.mjs:21431:19392)\n    at async SendMsg._handle (file:///usr/src/app/napcat/napcat.mjs:21435:14747)\n    at async SendMsg.websocketHandle (file:///usr/src/app/napcat/napcat.mjs:21427:7272)\n    at async ReverseWebsocket.onmessage (file:///usr/src/app/napcat/napcat.mjs:22072:7462)\n    at async WebSocket.<anonymous> (file:///usr/src/app/napcat/napcat.mjs:22072:11566)', wording='Error: 文件下载失败uri /app/plugins/miHoYoVoice/audio_temp/677c820e.silk 解析失败,TypeError [ERR_INVALID_URL]: Invalid URL 可能/app/plugins/miHoYoVoice/audio_temp/677c820e.silk不存在\n    at Object.fQxoR (file:///usr/src/app/napcat/napcat.mjs:21431:6629)\n    at handleOb11FileLikeMessage (file:///usr/src/app/napcat/napcat.mjs:21431:10914)\n    at async Object.record (file:///usr/src/app/napcat/napcat.mjs:21431:14373)\n    at async createSendElements (file:///usr/src/app/napcat/napcat.mjs:21431:19392)\n    at async SendMsg._handle (file:///usr/src/app/napcat/napcat.mjs:21435:14747)\n    at async SendMsg.websocketHandle (file:///usr/src/app/napcat/napcat.mjs:21427:7272)\n    at async ReverseWebsocket.onmessage (file:///usr/src/app/napcat/napcat.mjs:22072:7462)\n    at async WebSocket.<anonymous> (file:///usr/src/app/napcat/napcat.mjs:22072:11566)', echo={'seq': 2}>

image
1718037390157

回复语音消息异常

[2024-06-27 19:27:23.534] C:\Users\lx\Desktop\bot\QChatGPT\plugins\miHoYoVoice\main.py (114) - [INFO] :
使用角色“派蒙”生成回复语音
[2024-06-27 19:27:27.419] C:\Users\lx\Desktop\bot\QChatGPT\pkg\pipeline\controller.py (152) - [ERROR] :
处理请求时出错 query_id=1: <ActionFailed status='failed', retcode=200, data=None, echo={'seq': 1}>

代码如下:

if result:
# 回复语音消息
ctx.add_return("reply", [Voice(path=str(result))])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.