17 lines
377 B
C#
17 lines
377 B
C#
using System;
|
|
/// <summary>
|
|
/// 语音工具
|
|
/// </summary>
|
|
public class ZXKWakeup : Sensor
|
|
{
|
|
//唤醒词:小智小智
|
|
public Action callBack;//唤醒回调
|
|
public override void ReceiveData(string datas, string portName)
|
|
{
|
|
base.ReceiveData(datas, portName);
|
|
if (datas.TrimEnd('\n', '\r') == "hello")
|
|
{
|
|
callBack?.Invoke();
|
|
}
|
|
}
|
|
} |