yumoqing 41b362f0b6 feat: speaker-id service skeleton with ahserver + longtasks
- ahserver app on port 9095
- endpoints: status, enroll, identify, verify, compare
- ECAPA-TDNN model placeholder
- longtasks async task runner (enroll/identify/verify)
- direct cosine comparison endpoint
2026-07-21 17:33:07 +08:00

Speaker ID — 声纹识别服务

概述

基于 ECAPA-TDNN 的声纹识别/说话人识别服务。支持说话人注册、识别、比对。

模型

SpeechBrain ECAPA-TDNN (spkrec-ecapa-voxceleb) 部署于 GPU 服务器,使用 longtasks 异步任务模式。

API

端点 方法 说明
/api/status GET 服务状态和模型信息
/api/enroll POST 注册说话人 (音频 → 声纹特征)
/api/identify POST 识别说话人 (音频 → 匹配身份)
/api/verify POST 1:1 验证 (两段音频 → 是否同一人)
/api/compare POST 比对两个声纹向量的相似度

请求示例

POST /api/enroll
{
    "audio": "base64或文件路径",
    "speaker_id": "speaker_001",
    "speaker_name": "张三"
}

POST /api/identify
{
    "audio": "base64或文件路径",
    "threshold": 0.7,
    "top_k": 3
}

响应格式

{
    "status": "SUCCEEDED",
    "embedding": [0.123, -0.456, ...],
    "embedding_dim": 192,
    "elapsed": 0.523
}

部署

cd /data/ymq/speaker-id
bash build.sh
sudo systemctl restart speaker-id

端口

9095 (CPU + GPU)

Description
No description provided
Readme 30 KiB
Languages
Python 100%