Skip to content

Commit 9009a7e

Browse files
committed
升级 sdk
1 parent 8331160 commit 9009a7e

File tree

4 files changed

+97
-4
lines changed

4 files changed

+97
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ dependencies {
7979
implementation libs.androidx.core.ktx
8080
implementation libs.kotlinx.coroutines.android
8181
implementation libs.gson
82-
implementation 'com.tencent.iot.video:video-device-android:1.0.8.06-wakeup-SNAPSHOT'
82+
implementation 'com.tencent.iot.video:video-device-android:1.0.8.10-wakeup-SNAPSHOT'
8383
}

app/src/main/java/com/example/ivdemo/WakeupActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import android.util.Log
1414
import android.widget.SeekBar
1515
import android.widget.SeekBar.OnSeekBarChangeListener
1616
import android.widget.Toast
17-
import androidx.appcompat.app.AppCompatActivity
17+
import androidx.activity.ComponentActivity
1818
import androidx.core.content.ContextCompat
1919
import androidx.lifecycle.lifecycleScope
2020
import com.tencent.iot.twcall.R
@@ -29,7 +29,7 @@ import java.util.concurrent.Executors
2929

3030
private const val REQUEST_RECORD_AUDIO_PERMISSION = 200
3131

32-
class WakeupActivity : AppCompatActivity(), OnnxKwsBridge.OnWakeupListener {
32+
class WakeupActivity : ComponentActivity(), OnnxKwsBridge.OnWakeupListener {
3333

3434
private val TAG = WakeupActivity::class.java.simpleName
3535

app/src/main/res/layout/activity_wakeup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
android:layout_width="wrap_content"
2121
android:layout_height="wrap_content"
2222
android:layout_marginTop="16dp"
23-
android:text="唤醒词:“小多小多”、“你好小多"
23+
android:text="唤醒词:“小连小连”、“你好小连"
2424
android:textColor="@color/black"
2525
android:textSize="18sp"
2626
android:textStyle="bold"

docs/唤醒模块说明.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# 唤醒说明
2+
3+
**目录**
4+
5+
<!-- TOC -->
6+
- [1. 功能介绍](#1-功能介绍)
7+
- [2. 使用流程](#2-使用流程)
8+
- [3. 接口参考](#3-接口参考)
9+
- [接口列表](#接口列表)
10+
- [接口描述](#接口描述)
11+
- [init](#init)
12+
- [start](#start)
13+
- [stop](#stop)
14+
- [destroy](#destroy)
15+
16+
<!-- /TOC -->
17+
--------
18+
19+
# 1. 功能介绍
20+
21+
本模块提供设备的离线唤醒能力。
22+
23+
24+
# 2. 使用流程
25+
26+
1. 调用init初始化,传入参数context、productId,deviceName,deviceKey。
27+
2. 在需要调用唤醒的地方调用start,注start调用有一定的阻塞性,中间会有1秒多的耗时情况,若启动成功则会回调onStartSuccess、启动失败则会回调onStartFail。
28+
3. 在需要停止时调用stop,或者重起唤醒时可调用stop后在调用start。
29+
4. 回收时调用destroy。
30+
31+
32+
详细使用流程请参考例程代码WakeupActivity。
33+
34+
# 3. 接口参考
35+
36+
## 接口列表
37+
**该功能模块提供以下接口**
38+
* init() 初始化
39+
* destroy() 销毁
40+
* start() 唤醒启动
41+
* stop() 唤醒停止
42+
43+
**用户需注册以下回调函数**
44+
onMessage() 信息提示
45+
onStartSuccess() 启动成功回调
46+
onStartFail() 启动失败回调
47+
onResult() 获取唤醒结果
48+
49+
## 接口描述
50+
51+
### init
52+
53+
**功能描述**
54+
唤醒模块的初始化与预准备
55+
56+
**函数原型**
57+
```
58+
public void init(Context context, String productId, String deviceName, String deviceKey)
59+
```
60+
61+
**参数说明**
62+
| 参数名称 | 类型 | 描述 | 输入/输出 |
63+
| ----------- | -------------------- | ------------- | --------- |
64+
| context | Context | 上下文 | 输入 |
65+
| productId | String | 产品id | 输入 |
66+
| deviceName | String | 设备名称 | 输入 |
67+
| deviceKey | String | 设备密钥 | 输入 |
68+
69+
**返回值**
70+
| 返回值 | 描述 |
71+
| ----------- | -------------------- |
72+
|||
73+
74+
75+
### destroy
76+
77+
**功能描述**
78+
销毁唤醒模块。
79+
80+
**函数原型**
81+
```
82+
public void destroy()
83+
```
84+
85+
**参数说明**
86+
| 参数名称 | 类型 | 描述 | 输入/输出 |
87+
| -------- | ---- | ---- | --------- |
88+
|||||
89+
90+
**返回值**
91+
| 返回值 | 描述 |
92+
| ----------- | -------------------- |
93+
|||

0 commit comments

Comments
 (0)