默认连接超时时间为60秒,可根据需要调整 config.withTimeout(60); SSL配置(可选) // 根据需要配置是否跳过SSL证书验证 config.withIgnoreSSLVerification(true); 配置认证信息。 配置AK、SK、project_i
默认连接超时时间为60秒,可根据需要调整 config.withTimeout(60); SSL配置(可选) // 根据需要配置是否跳过SSL证书验证 config.withIgnoreSSLVerification(true); 配置认证信息。 配置AK、SK、project_i
如何修改发音人 修改代码中property的取值即可,支持的发音人如表1和表2所示。 POST https://{endpoint}/v1/{project_id}/tts Request Header: Content-Type: application/json X-Auth-Token:
连接超时,默认10,单位s。 read_timeout 否 Integer 读取超时,默认10,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为AsrCustomShortRequest,详见表3。 表3
代理初始化也可用不加密的代理,new ProxyHostInfo(host, port); // ProxyHostInfo proxy = new ProxyHostInfo(host, port, username, password); // config.setProxy(proxy);
代理初始化也可用不加密的代理,new ProxyHostInfo(host, port); // ProxyHostInfo proxy = new ProxyHostInfo(host, port, username, password); // config.setProxy(proxy);
连接超时,默认10,单位s。 read_timeout 否 String 读取超时,默认10,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为HotWordRequest,详见表3。 表3 HotWordRequest
连接超时,默认10,单位s。 read_timeout 否 String 读取超时,默认10,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为TtsCustomRequest,详见表3。 表3 TtsCustomRequest
recognized”? 可能原因 实时语音识别的初始静默时间过长无法识别。 解决方案 方法一:将参数设置中静默时间的参数vad_head 的值设置大一些,详细请参见API参考的实时语音识别的请求参数。 方法二:处理音频文件,将识别文件初始的静默音频剪切掉。 父主题: API使用类
连接超时,默认10,单位s。 read_timeout 否 Integer 读取超时,默认10,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为AsrCustomLongRequest,详见表3。 表3
代理初始化也可用不加密的代理,new ProxyHostInfo(host, port); // ProxyHostInfo proxy = new ProxyHostInfo(host, port, username, password); // config.setProxy(proxy);
代理密码(例:test)。 hostName 否 String 代理地址(例:“proxy.huaweicloud.com”)。 port 否 int 代理端口号(例:8080)。 表5 RasrResponseListener 函数 描述 void onResponseBegin(AsrResponse
代理密码(例:test)。 hostName 否 String 代理地址(例:“proxy.huaweicloud.com”)。 port 否 int 代理端口号(例:8080)。 其中RttsResponseListener使用户自定义的,建立webSocket之后,接受服务端返回消息的Listener。
代理初始化也可用不加密的代理,new ProxyHostInfo(host, port); // ProxyHostInfo proxy = new ProxyHostInfo(host, port, username, password); // config.setProxy(proxy);
调用录音文件识别接口,识别的结果出现两条完全一致的结果。 解决方案 由于声道设置的原因,单声道的音频按照双声道处理了。 在请求中将参数“channel”的值修改成“MONO”或者直接去掉请求参数中的“channel”项。 父主题: API使用类
add_punc 否 String 表示是否在识别结果中添加标点,取值为yes 、 no,默认no。 digit_norm 否 String 表示是否将语音中的数字识别为阿拉伯数字,取值为yes 、 no,默认为yes。识别结束后,会将数字识别为阿拉伯数字。 interim_results 否
连接超时,默认10,单位s。 read_timeout 否 Integer 读取超时,默认10,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为FlashLasrRequest,详见表3。 表3 FlashLasrRequest
代理密码(例:test)。 hostName 否 String 代理地址(例:“proxy.huaweicloud.com”)。 port 否 int 代理端口号(例:8080)。 表5 SasrWsResponseListener 函数 描述 void onExceededAudio();
websocket_wait_time 否 Integer websocket最大等待时间,默认20,单位s。 proxy 否 List [host, port] 或 [host, port, username, password]。 请求参数 请求类为RttsRequest,详见表3。 表3 RttsRequest
如何查看实时语音识别的中间结果 实时语音识别分为开始识别、发送音频数据、结束识别,断开连接四个阶段。在使用API或SDK时,可以通过将interim_results参数设置为yes,将识别过程的中间结果返回。如果设置为no,则会等每句话完毕才会返回识别结果。详细参数说明请见实时语音识别。 父主题:
您即将访问非华为云网站,请注意账号财产安全