blob: 049ca6574a7db73ba371e873d9457eaae1256b8c [file] [log] [blame]
Ytai Ben-Tsvifb557022021-03-05 17:05:19 -08001/*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.soundtrigger3;
18
19import android.media.soundtrigger.PhraseRecognitionEvent;
20import android.media.soundtrigger.RecognitionEvent;
21
22/**
23 * SoundTrigger HAL per-model Callback interface.
24 */
25@VintfStability
26interface ISoundTriggerHwCallback {
27 /**
28 * Callback method called by the HAL when a model has been unloaded at the HAL implementation's
29 * discretion.
30 * This event may only be delivered when the model state is 'stopped'.
31 * This event is NOT sent as part of an unload sequence initiated by the client.
32 *
33 * @param model The model handle.
34 */
35 void modelUnloaded(in int model);
36
37 /**
38 * Callback method called by the HAL when the sound recognition triggers for a key phrase sound
39 * model.
40 * This event may only be delivered when the model state is 'started'.
41 * Unless the status of the event is RecognitionStatus.FORCED, this event indicates that the
42 * state of this model has become 'stopped'.
43 *
44 * @param event A RecognitionEvent structure containing detailed results of the recognition
45 * triggered
46 */
47 void phraseRecognitionCallback(in int model, in PhraseRecognitionEvent event);
48
49 /**
50 * Callback method called by the HAL when the sound recognition triggers.
51 * This event may only be delivered when the model state is 'started'.
52 * Unless the status of the event is RecognitionStatus.FORCED, this event indicates that the
53 * state of this model has become 'stopped'.
54 *
55 * @param event A RecognitionEvent structure containing detailed results of the recognition
56 * triggered
57 */
58 void recognitionCallback(in int model, in RecognitionEvent event);
59}