Git Product home page Git Product logo

newchatvoice's Introduction

NewChatVoice插件使用教程

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

NewChatVoice插件介绍

本插件调用了海豚Ai TTS-Online文本转语音的接口,用于将QChatGPT返回的内容转换为多种角色语音

特点:速度快,低价,效果好,支持原神、星铁、日漫1000+个角色、鸣潮、红警、APEX等多种类型的角色音色

TODO:

  • 支持更多TTS平台,包括在线和本地的,如GPT-SoVITS
  • 支持返回更长语音
  • 可能的WebUI配置页面,实现支持在线页面切换

版本记录

NewChatVoice 1.1

  • 新增 外部调用接口。

    • 外部调用将使用相同的插件配置文件,但无视voice_switch状态。

    • 接口函数:

      async def ncv_tts(self, user_id: str, text: str) -> Voice:
          """
          供外部调用的文字转Voice的接口
      
          Args:
              user_id (str): 会话ID
              text (str): 要转换的文本
      
          Returns:
              Voice: 生成的语音对象
          """
    • 调用示例:

      async def handle_voice_synthesis(self, launcher_id: int, text: str, ctx: EventContext):
          try:
              from plugins.NewChatVoice.main import VoicePlugin, VoiceSynthesisError
          except ImportError as e:
              self.ap.logger.error(f"Failed to import VoicePlugin: {e}")
              return False
      
          ncv = VoicePlugin(self.host)
          try:
              voice = await ncv.ncv_tts(launcher_id, text)
              await ctx.event.query.adapter.reply_message(ctx.event.query.message_event, MessageChain([voice]), False)
              return True
          except VoiceSynthesisError as e:
              self.ap.logger.error(f"{e}")
              return False
  • 优化 配置文件逻辑。

    • 配置将分为 通用配置 “conifg.yaml”,以及会话配置 “config_[会话].yaml”
    • 会话配置 优先级高于 通用配置

NewChatVoice插件使用(重要)

配置完成 QChatGPT 主程序后使用管理员账号向机器人发送命令即可安装:

!plugin get https://github.com/the-lazy-me/NewChatVoice

或查看详细的插件安装说明

token获取(重要)

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

点击升级专业版

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

复制粘贴给出的网址

配置(重要)

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

# 语音角色id,可在对话中指定角色,不指定则为使用默认角色(派蒙 430)
character_id: 430
# 是否为每个用户默认开启语音功能,默认为False,即不开启,True为默认开启
voice_switch: False
# 语音传输方式:path/base64,如果遇到消息平台访问权限问题,可尝试切换
voice_type: path
# 语音缓存路径,如果遇到消息平台访问权限问题,可以尝试修改至消息平台有权限访问的目录
temp_dir_path: plugins/NewChatVoice/audio_temp
# token,这个是必须的,不然无法使用,获取方式请看文档
token: 填入购买后显示的网站

重点关注:token,在汉字提示处填入刚刚复制网址,保存即可

指令(重要)

对话中,发送

  • !ncv 开启
  • !ncv 关闭
  • !ncv 状态
  • !ncv 角色列表
  • !ncv 切换 <角色id>
  • !ncv 帮助

角色列表:

飞书云文档:https://s1c65jp249c.feishu.cn/sheets/WoiOsshwfhtUXRt2ZS0cVMCFnLc?from=from_copylink 腾讯文档:https://docs.qq.com/sheet/DSFhQT3dUZkpabHVu?tab=BB08J2 切换角色请使用id,例如切换角色为流萤(id为2075): !ncv 切换 2075

newchatvoice's People

Contributors

the-lazy-me avatar elvischenml avatar

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.