Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

语音服务接口定义,ASR模块一堆无效参数 #3376

Open
Javacr opened this issue Jul 6, 2023 · 2 comments
Open

语音服务接口定义,ASR模块一堆无效参数 #3376

Javacr opened this issue Jul 6, 2023 · 2 comments

Comments

@Javacr
Copy link

Javacr commented Jul 6, 2023

General Question

代码和文档说明不对等,文档里的接口如下:

语音识别

  • url:POST /paddlespeech/asr
  • 请求body参数
字段 必选 类型 说明
audio string 将音频文件进行 base64编码后得到的 string
audio_format string 合成音频文件格式,可选:pcm、wav,默认值:wav
sample_rate int 音频的采样率,值选择 [8000, 16000],默认与模型采样率一致
lang string 语种 zh_cn:中文; zh_tw: 台湾普通话; en_us:英文
punc bool 是否开启标点符号添加 true:开启 false:关闭(默认值)

代码接口使用如下

        audio_data = base64.b64decode(request_body.audio)


        # get single engine from engine pool
        engine_pool = get_engine_pool()
        asr_engine = engine_pool['asr']


        if asr_engine.engine_type == "python":
            from paddlespeech.server.engine.asr.python.asr_engine import PaddleASRConnectionHandler
        elif asr_engine.engine_type == "inference":
            from paddlespeech.server.engine.asr.paddleinference.asr_engine import PaddleASRConnectionHandler
        else:
            logger.error("Offline asr engine only support python or inference.")
            sys.exit(-1)


        connection_handler = PaddleASRConnectionHandler(asr_engine)


        connection_handler.run(audio_data)

不知道是不是我理解错了,但是从文档和代码来看,audio之外的参数,都是没有任何意义的。是代码没有更新吗,还是说代码没有实现这些功能,但是未来会加上。

@Javacr Javacr added the Question label Jul 6, 2023
@zh794390558
Copy link
Collaborator

文档略微落后于代码,已代码实现为主。

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants