qcloud-iotexplorer-h5-panel-sdk
Advanced tools
Comparing version 1.1.21 to 1.1.22-beta.1
{ | ||
"name": "qcloud-iotexplorer-h5-panel-sdk", | ||
"version": "1.1.21", | ||
"version": "1.1.22-beta.1", | ||
"description": "", | ||
@@ -30,2 +30,3 @@ "main": "dist/release/qcloud-iotexplorer-h5-panel-sdk", | ||
"event-emitter-for-miniprogram": "0.0.8", | ||
"load-js": "^3.0.3", | ||
"qcloud-iotexplorer-appdev-sdk": "^1.0.20", | ||
@@ -32,0 +33,0 @@ "qcloud-iotexplorer-bluetooth-adapter": "^0.0.28", |
@@ -503,2 +503,61 @@ # qcloud-iotexplorer-h5-panel-sdk | ||
## ASR语音识别 | ||
### API | ||
#### 创建识别任务 sdk.voiceRecognition: (options) => Promise\<result\> | ||
##### 参数说明 | ||
* options.DeviceId?: string; 默认使用当前设备的设备ID | ||
* options.AudioType: 'file' | 'sentence' 识别场景。"录音文件"取值"file"、"一句话识别"取值"sentence" | ||
* options.ResourceName?: string; 文件名称,如果Data类型是File,则取其"name"作为默认值 | ||
* options.Data: Blob | File; 音频文件 | ||
* options.EngineType?: string; 引擎模型类型,默认值为 "16k_zh" | ||
* options.FilterDirty?: number; 是否过滤脏词 | ||
* options.FilterModal?: number; 是否过滤语气词 | ||
* options.FilterPunc?: number; 是否过滤标点符号 | ||
* options.ConvertNumMode?: number; 是否开启阿拉伯转换 | ||
* options.ChannelNum?: number; 语音声道数,默认为1(仅针对识别场景"录音文件"有效) | ||
* options.SpeakerDiarization?: number; 是否开启话者分离(仅针对识别场景"录音文件"有效) | ||
* options.SpeakerNumber?: number; 话者分离人数(仅针对识别场景"录音文件"有效) | ||
关于"录音文件"场景支持的音频类型、大小限制以及相关字段的详细介绍,请参见 [ASR - 录音文件识别](https://cloud.tencent.com/document/api/1093/37823) | ||
关于"一句话识别"场景支持的音频类型、大小限制以及相关字段的详细介绍,请参见 [ASR - 一句话识别](https://cloud.tencent.com/document/api/1093/35646) | ||
##### 返回值说明 | ||
* result.ResourceToken: string; 某个设备下,音频文件的唯一标示 | ||
目前支持两种场景,分别为"录音文件"与"一句话识别",两种场景下入参会有所不同。 | ||
由于识别过程是异步,因此接口"voiceRecognition"并不会立即返回识别结果, | ||
可以理解为该接口是创建了一个"异步任务",当这个成功被创建的"异步任务"执行完后,会通过websocket将结果推送到所有订阅了该deviceId的终端上,下面会详细介绍 | ||
#### 监听识别结果 sdk.on('asrResponse', ({ deviceId, data }) => void) | ||
##### 返回值说明 | ||
* deviceId: string; 设备ID | ||
* data.resource_token: string; 某个设备下,音频文件的唯一标示 | ||
* data.result_code: number; 状态码,0代表成功 | ||
* data.total_num: number; 分片总数 | ||
* data.seq: number; 当前分片序号 | ||
* data.res_text: string; 当前分片识别结果,对于"录音文件"场景,识别结果会包含分段时间戳 | ||
对于"录音文件"场景,如果音频文件过大,后台可能会对音频文件进行分片识别,每个分片识别完成后,都会推送一条websocket消息,但推送的消息不保证顺序。(例如有可能分片2的结果先到达) | ||
对于"asrResponse"事件,实际是基于"wsControl"事件做二次封装;当然,开发者也可以通过监听"wsControl"事件获取识别结果 | ||
#### 获取语音文件链接(仅限"录音文件"场景) sdk.getAsrDownloadUrl(options) => Promise\<result\> | ||
##### 参数说明 | ||
* options.DeviceId: string; 设备ID | ||
* options.ResourceToken: string; 调用voiceRecognition返回的ResourceToken | ||
##### 返回值说明 | ||
* result.ResourceURL: string; cos访问URL | ||
## 蓝牙模块 | ||
@@ -757,2 +816,6 @@ 由于h5中无法直接调用小程序蓝牙相关接口,sdk封装了特殊的蓝牙模块,通过一个单独的websocket通道打通了h5到小程序直接的蓝牙通信 | ||
### v1.1.22-beta.1(2020.11.20) | ||
* 增加asr语音识别功能 | ||
### v1.1.19(2020.9.23) | ||
@@ -759,0 +822,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
311035
6
1123
0
876
6
2
1
+ Addedload-js@^3.0.3
+ Addedload-js@3.1.1(transitive)