-
Notifications
You must be signed in to change notification settings - Fork 2.6k
update:python单模块部署声纹识别对接 #1755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update:python单模块部署声纹识别对接 #1755
Conversation
|
哟吼,有大神兄弟做出来声纹识别啦 |
openrz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最后,测试一下流式的TTS是否也能同时判断说话人。
| # 创建全局线程池执行器用于CPU密集型操作 | ||
| executor = concurrent.futures.ThreadPoolExecutor(max_workers=4) | ||
|
|
||
| class VoiceprintProvider: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以把它独立出来一个py文件
| "当用户消息包含 [说话人: 姓名] 前缀时,表示系统已识别出说话人身份。\n" \ | ||
| "请根据说话人的身份特征(如果之前有相关信息)来调整回应风格和内容。\n" \ | ||
| "你可以称呼说话人的名字,并参考他们的特点进行个性化回应。" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加说话人的个性化描述,for循环出来,如果描述为空,“”
| frame_duration = 60 # 帧时长(毫秒),匹配 Opus 编码 | ||
| start_time = time.perf_counter() | ||
| play_position = 0 | ||
| last_reset_time = time.perf_counter() # 记录最后的重置时间 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否是不小心去掉了?
main/xiaozhi-server/config.yaml
Outdated
| - ".p3" | ||
| refresh_time: 300 # 刷新音乐列表的时间间隔,单位为秒 | ||
| # 声纹识别配置 | ||
| voiceprint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
voiceprint不需要放在plugins下面
| return result_name | ||
| else: | ||
| logger.bind(tag=TAG).warning(f"未识别的说话人ID: {speaker_id}") | ||
| return "未知说话人" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果识别不到说话人,后续不要用json封装用户的的说话内容
openrz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显示在用户界面的内容,不要是json格式
No description provided.