智能客服
你问我答,随时在线为你解决问题
Class Info |
|---|
com.huawei.hms.mlsdk.sounddect.MLSoundDetector 声音识别。 |
Qualifier and Type | Field and Description | |
|---|---|---|
String | 识别成功后获取到的声音类型key。 | |
Qualifier and Type | Method Name and Description |
|---|---|
static MLSoundDetector | 创建声音识别器。 |
void | destroy() 释放声音识别器资源。 |
void | setSoundDetectListener(MLSoundDetectListener listener) 设置声音识别器回调监听。 |
boolean | start(Context context) 开始检测,麦克风拾取的实时音频数据。 |
void | stop() 停止识别麦克风拾取的音频数据,并不会释放资源。 |
Field |
|---|
public static final String RESULTS_RECOGNIZED 识别成功后获取到的声音类型key。 Constant Value: "results_Detector" |
Method |
|---|
public static MLSoundDetector createSoundDetector() 创建声音识别器。 |
Type | Description |
|---|---|
声音识别实例。 |
Method |
|---|
public void destroy() 释放声音识别器资源。 |
Method |
|---|
public void setSoundDetectListener(MLSoundDetectListener listener) 设置声音识别器回调监听。 |
Name | Description |
|---|---|
listener | 回调函数。 |
Method |
|---|
public boolean start(Context context) 开始检测,麦克风拾取的实时音频数据,setSoundDetectListener(MLSoundDetectListener listener)设置监听器才能接收结果。 |
Name | Description |
|---|---|
context | 上下文。 |
Type | Description |
|---|---|
boolean | 开始声音识别服务结果。
|
Method |
|---|
public void stop() 停止识别麦克风拾取的音频数据,并不会释放资源。 |