Alexa Auto SDK  2.3.1
SpeechRecognizer.h
1 /*
2  * Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef AACE_ALEXA_SPEECH_RECOGNIZER_H
17 #define AACE_ALEXA_SPEECH_RECOGNIZER_H
18 
19 #include <AACE/Core/PlatformInterface.h>
20 #include "AlexaEngineInterfaces.h"
21 
24 namespace aace {
25 namespace alexa {
26 
40 protected:
41  SpeechRecognizer(bool wakewordDetectionEnabled = true);
42 
43 public:
44  virtual ~SpeechRecognizer();
45 
51 
52  /*
53  * Defines an unspecified value for the speech recognizers audio index.
54  */
55  static constexpr uint64_t UNSPECIFIED_INDEX = SpeechRecognizerEngineInterface::UNSPECIFIED_INDEX;
56 
67  bool holdToTalk();
68 
79  bool tapToTalk();
80 
98  bool startCapture(
99  Initiator initiator,
100  uint64_t keywordBegin = UNSPECIFIED_INDEX,
101  uint64_t keywordEnd = UNSPECIFIED_INDEX,
102  const std::string& keyword = "");
103 
110  bool stopCapture();
111 
122 
132 
142 
150  virtual bool wakewordDetected(const std::string& wakeword);
151 
156  virtual void endOfSpeechDetected();
157 
164  void setEngineInterface(
165  std::shared_ptr<aace::alexa::SpeechRecognizerEngineInterface> speechRecognizerEngineInterface);
166 
167 private:
168  std::weak_ptr<aace::alexa::SpeechRecognizerEngineInterface> m_speechRecognizerEngineInterface;
169 
170  bool m_wakewordDetectionEnabled;
171 };
172 
173 } // namespace alexa
174 } // namespace aace
175 
176 #endif // AACE_ALEXA_SPEECH_RECOGNIZER_H
bool stopCapture()
Definition: SpeechRecognizer.cpp:47
bool isWakewordDetectionEnabled()
Definition: SpeechRecognizer.cpp:75
virtual void endOfSpeechDetected()
Definition: SpeechRecognizer.cpp:83
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
bool enableWakewordDetection()
Definition: SpeechRecognizer.cpp:55
Definition: SpeechRecognizer.h:39
bool holdToTalk()
Definition: SpeechRecognizer.cpp:27
bool tapToTalk()
Definition: SpeechRecognizer.cpp:31
virtual bool wakewordDetected(const std::string &wakeword)
Definition: SpeechRecognizer.cpp:79
bool disableWakewordDetection()
Definition: SpeechRecognizer.cpp:65
Initiator
Definition: AlexaEngineInterfaces.h:77
bool startCapture(Initiator initiator, uint64_t keywordBegin=UNSPECIFIED_INDEX, uint64_t keywordEnd=UNSPECIFIED_INDEX, const std::string &keyword="")
Definition: SpeechRecognizer.cpp:35

Alexa Auto SDK 2.3.1 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0