Skip to content

Conversation

@studentCGD
Copy link
Collaborator

No description provided.

@shenxueyuan
Copy link

哟吼,有大神兄弟做出来声纹识别啦

Copy link
Collaborator

@openrz openrz left a 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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以把它独立出来一个py文件

"当用户消息包含 [说话人: 姓名] 前缀时,表示系统已识别出说话人身份。\n" \
"请根据说话人的身份特征(如果之前有相关信息)来调整回应风格和内容。\n" \
"你可以称呼说话人的名字,并参考他们的特点进行个性化回应。"

Copy link
Collaborator

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() # 记录最后的重置时间
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是否是不小心去掉了?

- ".p3"
refresh_time: 300 # 刷新音乐列表的时间间隔,单位为秒
# 声纹识别配置
voiceprint:
Copy link
Collaborator

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 "未知说话人"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果识别不到说话人,后续不要用json封装用户的的说话内容

Copy link
Collaborator

@openrz openrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

显示在用户界面的内容,不要是json格式

@openrz openrz changed the base branch from main to mangger-api-voice-print July 9, 2025 08:45
@openrz openrz merged commit 38409b4 into mangger-api-voice-print Jul 9, 2025
@openrz openrz deleted the py_test branch July 9, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants