Coder Social home page Coder Social logo

dingdangdog / blivedm-voice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xfgryujk/blivedm

1.0 0.0 0.0 169 KB

基于blivedm仓库的bilibili直播弹幕语音播报机器人,支持windows本地语音、Azure、Alibaba

License: MIT License

Python 100.00%
tts

blivedm-voice's Introduction

blivedm-voice

Fork Form:blivedm

package

执行 pip install pyinstaller 安装 pyinstaller,然后执行下面的打包脚本:

Execute pip install pyinstaller to install pyinstaller, and then execute the following packaging script:

# pyinstaller --onefile blivemd-voice.py

# windows azure
pyinstaller --onefile --add-data "./.venv/Lib/site-packages/azure;azure" blivemd-voice.py

config

文件名:config.json,默认配置:

{
  "platform":"win",
  "mode":"local",
  "room_ids":[],
  "bilibili_SESSION":"",
  "bilibili_heart_print": 10,
  "continuous_gift_interval": 1,
  "welcome_level": 0,
  "voice_text": {
    "enter": "欢迎 {uname} 进入直播间,记得常来玩哦!",
    "danmaku": "{uname}说:{msg}",
    "gift": "感谢 {uname} 赠送的 {num}个{gift_name},谢谢老板,老板大气!",
    "like": "感谢 {uname} {like_text}",
    "like_total": "本次直播点赞数量超过 {limit_num} 次,达到 {click_count} 次"
  },
  "like_nums": [66, 188, 300, 500, 666, 888, 999, 1666],
  "max_next_interval": 100
}

platform

目前仅支持windows。

可选配置(select):

  • win (default)
  • mac
  • linux

mode

可选配置(select):

  • local (default)
  • azure
  • alibaba
  • sovits

bilibili_SESSION

这里应该写一个已登录的SESSDATA,你可以在cookie中获取它。 不填写也可以连接,但是不会获取用户名和id。

There should to write a logged in SESSDATA, you can get it in cookie. You can connect without filling it in, but username and id will not be obtained.

bilibili_heart_print

  • 含义:心跳监听次数
  • 默认值:10
  • 作用:心跳监控信息打印心跳次数间隔。

Heartbeat monitoring information printing interval.

welcome_level

  • 含义:用户粉丝牌等级
  • 默认值:0
  • 作用:进场提示音等级控制,粉丝牌大于等于指定等级的用户进入房间,才会用欢迎语音和弹幕提示

continuous_gift_interval

  • 含义:秒
  • 默认值:1
  • 作用:用于配置连续礼物的时间间隔,时间间隔内的相同礼物将会合并播报。

Used to configure the time interval for consecutive gifts. The same gifts within the time interval will be combined and broadcast.

voice_text

用于配置常用的语音文本。

Used to configure commonly used voice texts.

默认配置(default):

{
    "enter": "欢迎 {uname} 进入直播间,记得常来玩哦!",
    "danmaku": "{uname}说:{msg}",
    "gift": "感谢 {uname} 赠送的 {num}个{gift_name},谢谢老板,老板大气!",
    "like": "感谢 {uname} {like_text}",
    "like_total": "本次直播点赞数量达到 {click_count} 次"
}

配置详细说明:

  • enter:进入直播间的语音文字,uname 会自动替换为用户昵称;
  • danmaku:弹幕播报的语音文字,uname-用户昵称、msg-弹幕内容;
  • gift:礼物播报的语音文字,uname-用户昵称、num-礼物个数、gift_name-礼物名称;
  • like:用户点赞的语音文字,uname-用户昵称、like_text-B站官方点赞提示文字;
  • like_total:点赞总结的语音文字,click_count-总点赞次数。

like_nums(待测试)

  • 含义:点赞数量数组
  • 默认值:[66, 188, 300, 500, 666, 888, 999, 1666]
  • 作用:指定需要语音播报的点赞数量,当低于最小值时,语音不会做任何播报

max_next_interval

  • 含义:点赞超过上限后的递增数量
  • 默认值:100
  • 作用:点赞数量超过设定数组 like_nums 的最大值后,后续语音播报与上次语音播报的间隔

azure_config

文件名:config_azure.json,默认配置:

{
  "azure_key":"",
  "azure_model":"",
  "azure_region":"",
  "azure_endpoint":""
}

azure_model

语音服务的语言和声音支持

Language and voice support for the Speech service

  • 中文模型(2024年1月记录):
{
	"zh-CN-XiaoxiaoNeural": "(女)(default)",
	"zh-CN-YunxiNeural": "(男)",
	"zh-CN-YunjianNeural": "(男)",
	"zh-CN-XiaoyiNeural": "(女)",
	"zh-CN-YunyangNeural": "(男)",
	"zh-CN-XiaochenNeural": "(女)",
	"zh-CN-XiaohanNeural": "(女)",
	"zh-CN-XiaomengNeural": "(女)",
	"zh-CN-XiaomoNeural": "(女)",
	"zh-CN-XiaoqiuNeural": "(女)",
	"zh-CN-XiaoruiNeural": "(女)",
	"zh-CN-XiaoshuangNeural": "(女性、儿童)",
	"zh-CN-XiaoxuanNeural": "(女)",
	"zh-CN-XiaoyanNeural": "(女)",
	"zh-CN-XiaoyouNeural": "(女性、儿童)",
	"zh-CN-XiaozhenNeural": "(女)",
	"zh-CN-YunfengNeural": "(男)",
	"zh-CN-YunhaoNeural": "(男)",
	"zh-CN-YunxiaNeural": "(男)",
	"zh-CN-YunyeNeural": "(男)",
	"zh-CN-YunzeNeural": "(男)",
	"zh-CN-XiaochenMultilingualNeural1": "(女)",
	"zh-CN-XiaorouNeural1": "(女)",
	"zh-CN-XiaoxiaoDialectsNeural1": "(女)",
	"zh-CN-XiaoxiaoMultilingualNeural1": "(女)no voice?",
	"zh-CN-YunjieNeural1": "(男)",
	"zh-CN-YunyiMultilingualNeural1": "(男)"
}

config_alibaba

已支持阿里巴巴的【智能语音交互】,目前以测试方式集成,需要每天申请token。

文件名:config_alibaba.json,默认配置:

{
  "alibaba_appkey":"",
  "alibaba_token":"",
  "alibaba_model":"xiaoyun",
  "alibaba_endpoint":"nls-gateway-cn-shanghai.aliyuncs.com"
}

alibaba 智能语音交互的配置如上所示,参数介绍:

  • alibaba_appkey:智能语音交互创建项目后,项目的appkey
  • alibaba_token:目前仅支持通过控制台获取临时token,临时token有效时间为24小时,失效后需要重新获取,获取方式可参考:阿里云文档
  • alibaba_model:参考官方文档:语音合成-接口说明
  • alibaba_endpoint:阿里云接口节点,有上海shanghai、北京beijing 、深圳shenzhen三个节点,自行修改即可。

config_soVits

以下是使用 GPT-soVITS-Interface 时需要配置的信息,其中除 sovits_host 配置项外,都可以忽略不填,具体配置参数请自行学习 GPT-soVITS-Interface,本仓库不做介绍。

{
  "sovits_host":"http://127.0.0.1:5000/tts",
  "sovits_model":"Hutao",
  "sovits_language":"auto",
  "sovits_emotion":"",
  "sovits_top_k":"",
  "sovits_top_p":"",
  "sovits_temperature":"",
  "sovits_batch_size":"",
  "sovits_speed":"1.0",
  "sovits_save_temp":"false",
  "sovits_stream":"false",
  "sovits_format":"wav"
}

blivedm-voice's People

Contributors

xfgryujk avatar dingdangdog avatar dependabot[bot] avatar kinorin avatar tomatopuddin avatar no1xsyzy avatar brainbush avatar nilknow avatar

Stargazers

 avatar

blivedm-voice's Issues

优化点记录

  1. 项目代码整理
  2. 增加房间配置文件
  3. 礼物单独赠送多个时,合并语音
  4. 成为高能用户提示

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.