mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
35 lines
919 B
Python
35 lines
919 B
Python
|
||
"""
|
||
科大讯飞 voice service
|
||
"""
|
||
|
||
from voice.voice import Voice
|
||
|
||
# 科大讯飞语音识别
|
||
lfasr_host = 'http://raasr.xfyun.cn/api'
|
||
# 请求的接口名
|
||
api_prepare = '/prepare'
|
||
api_upload = '/upload'
|
||
api_merge = '/merge'
|
||
api_get_progress = '/getProgress'
|
||
api_get_result = '/getResult'
|
||
# 文件分片大小10M
|
||
file_piece_sice = 10485760
|
||
# ——————————————————转写可配置参数————————————————
|
||
# 参数可在官网界面(https://doc.xfyun.cn/rest_api/%E8%AF%AD%E9%9F%B3%E8%BD%AC%E5%86%99.html)查看,根据需求可自行在gene_params方法里添加修改
|
||
# 转写类型
|
||
lfasr_type = 0
|
||
# 是否开启分词
|
||
has_participle = 'false'
|
||
has_seperate = 'true'
|
||
# 多候选词个数
|
||
max_alternatives = 0
|
||
# 子用户标识
|
||
suid = ''
|
||
|
||
class XfyunVoice(Voice):
|
||
def __init__(self):
|
||
pass
|
||
|
||
def voiceToText(self, voice_file):
|
||
pass |