1 /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 // Provides an interface to take an action based on an audio command.
17 
18 #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_COMMAND_RESPONDER_H_
19 #define TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_COMMAND_RESPONDER_H_
20 
21 #include "tensorflow/lite/c/common.h"
22 #include "tensorflow/lite/micro/micro_error_reporter.h"
23 
24 // Called every time the results of an audio recognition run are available. The
25 // human-readable name of any recognized command is in the `found_command`
26 // argument, `score` has the numerical confidence, and `is_new_command` is set
27 // if the previous command was different to this one.
28 void RespondToCommand(tflite::ErrorReporter* error_reporter,
29                       int32_t current_time, const char* found_command,
30                       uint8_t score, bool is_new_command);
31 void RespondCommandThreadInit(void);
32 
33 #endif  // TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_COMMAND_RESPONDER_H_
34