949 B
949 B
Text to BlendShapes API
将文字转换为52个形态键的API服务
功能
- 文字 → 音频 (使用 gTTS)
- 音频 → CSV (使用 Audio2Face)
- CSV → 52个形态键数据
安装
cd a2f_api
pip install -r requirements.txt
使用
python api.py
服务将在 http://localhost:5001 启动
API 接口
POST /text-to-blendshapes
请求:
{
"text": "你好世界",
"language": "zh-CN"
}
响应:
{
"success": true,
"frames": [
{
"timeCode": 0.0,
"blendShapes": {
"EyeBlinkLeft": 0.0,
"EyeLookDownLeft": 0.0,
...
"TongueOut": 0.0
}
}
],
"audio_path": "...",
"csv_path": "..."
}
文件说明
tts_service.py- 文字转音频服务a2f_service.py- Audio2Face包装器blend_shape_parser.py- CSV解析器text_to_blendshapes_service.py- 主服务api.py- Flask API