From b8c5174da5eb45f51cf39386d3a55fef2553ce6a Mon Sep 17 00:00:00 2001 From: Saboteur7 Date: Tue, 4 Jun 2024 13:49:44 +0800 Subject: [PATCH] docs: xunfei voice comment --- README.md | 4 ++-- voice/xunfei/config.json.template | 10 +++++----- voice/xunfei/xunfei_voice.py | 9 +++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cb4f262..33e8a47 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ pip3 install -r requirements-optional.txt "subscribe_msg": "感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持角色扮演和文字冒险等丰富插件。\n输入{trigger_prefix}#help 查看详细指令。", "use_linkai": false, # 是否使用LinkAI接口,默认关闭,开启后可国内访问,使用知识库和MJ "linkai_api_key": "", # LinkAI Api Key - "linkai_app_code": "" # LinkAI 应用code + "linkai_app_code": "" # LinkAI 应用或工作流code } ``` **配置说明:** @@ -183,7 +183,7 @@ pip3 install -r requirements-optional.txt + `use_linkai`: 是否使用LinkAI接口,开启后可国内访问,使用知识库和 `Midjourney` 绘画, 参考 [文档](https://link-ai.tech/platform/link-app/wechat) + `linkai_api_key`: LinkAI Api Key,可在 [控制台](https://link-ai.tech/console/interface) 创建 -+ `linkai_app_code`: LinkAI 应用code,选填 ++ `linkai_app_code`: LinkAI 应用或工作流的code,选填 **本说明文档可能会未及时更新,当前所有可选的配置项均在该[`config.py`](https://github.com/zhayujie/chatgpt-on-wechat/blob/master/config.py)中列出。** diff --git a/voice/xunfei/config.json.template b/voice/xunfei/config.json.template index 1a02f28..770160d 100644 --- a/voice/xunfei/config.json.template +++ b/voice/xunfei/config.json.template @@ -1,7 +1,7 @@ { - "APPID":"xxx71xxx", #讯飞xfyun.cn控制台中应用的ID - "APIKey":"xxxx69058exxxxxx", #讯飞xfyun.cn控制台语音合成或者听写界面的APIKey - "APISecret":"xxxx697f0xxxxxx", #讯飞xfyun.cn控制台语音合成或者听写界面的APIKey - "BusinessArgsTTS":{"aue": "lame", "sfl": 1, "auf": "audio/L16;rate=16000", "vcn": "xiaoyan", "tte": "utf8"}, #语音合成的参数,具体可以参考xfyun.cn的文档 - "BusinessArgsASR":{"domain": "iat", "language": "zh_cn", "accent": "mandarin", "vad_eos":10000, "dwa": "wpgs"} #语音听写的参数,具体可以参考xfyun.cn的文档 + "APPID":"xxx71xxx", + "APIKey":"xxxx69058exxxxxx", + "APISecret":"xxxx697f0xxxxxx", + "BusinessArgsTTS":{"aue": "lame", "sfl": 1, "auf": "audio/L16;rate=16000", "vcn": "xiaoyan", "tte": "utf8"}, + "BusinessArgsASR":{"domain": "iat", "language": "zh_cn", "accent": "mandarin", "vad_eos":10000, "dwa": "wpgs"} } diff --git a/voice/xunfei/xunfei_voice.py b/voice/xunfei/xunfei_voice.py index f16714d..7b503f7 100644 --- a/voice/xunfei/xunfei_voice.py +++ b/voice/xunfei/xunfei_voice.py @@ -6,6 +6,15 @@ # 要使用本模块, 首先到 xfyun.cn 注册一个开发者账号, # 之后创建一个新应用, 然后在应用管理的语音识别或者语音合同右边可以查看APPID API Key 和 Secret Key # 然后在 config.json 中填入这三个值 +# +# 配置说明: +# { +# "APPID":"xxx71xxx", +# "APIKey":"xxxx69058exxxxxx", #讯飞xfyun.cn控制台语音合成或者听写界面的APIKey +# "APISecret":"xxxx697f0xxxxxx", #讯飞xfyun.cn控制台语音合成或者听写界面的APIKey +# "BusinessArgsTTS":{"aue": "lame", "sfl": 1, "auf": "audio/L16;rate=16000", "vcn": "xiaoyan", "tte": "utf8"}, #语音合成的参数,具体可以参考xfyun.cn的文档 +# "BusinessArgsASR":{"domain": "iat", "language": "zh_cn", "accent": "mandarin", "vad_eos":10000, "dwa": "wpgs"} #语音听写的参数,具体可以参考xfyun.cn的文档 +# } ##################################################################### import json