Alexa Auto SDK  2.0.0
SpeechRecognizer.h
1 /*
2  * Copyright 2017-2019 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( Initiator initiator, uint64_t keywordBegin = UNSPECIFIED_INDEX, uint64_t keywordEnd = UNSPECIFIED_INDEX, const std::string& keyword = "" );
99 
106  bool stopCapture();
107 
115 
122 
129 
137  virtual bool wakewordDetected( const std::string& wakeword );
138 
143  virtual void endOfSpeechDetected();
144 
151  void setEngineInterface( std::shared_ptr<aace::alexa::SpeechRecognizerEngineInterface> speechRecognizerEngineInterface );
152 
153 private:
154  std::weak_ptr<aace::alexa::SpeechRecognizerEngineInterface> m_speechRecognizerEngineInterface;
155 
156  bool m_wakewordDetectionEnabled;
157 };
158 
159 } // aace::alexa
160 } // aace
161 
162 #endif // AACE_ALEXA_SPEECH_RECOGNIZER_H
bool stopCapture()
Definition: SpeechRecognizer.cpp:43
bool isWakewordDetectionEnabled()
Definition: SpeechRecognizer.cpp:76
virtual void endOfSpeechDetected()
Definition: SpeechRecognizer.cpp:84
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
bool enableWakewordDetection()
Definition: SpeechRecognizer.cpp:52
Definition: SpeechRecognizer.h:39
bool holdToTalk()
Definition: SpeechRecognizer.cpp:26
bool tapToTalk()
Definition: SpeechRecognizer.cpp:30
virtual bool wakewordDetected(const std::string &wakeword)
Definition: SpeechRecognizer.cpp:80
bool disableWakewordDetection()
Definition: SpeechRecognizer.cpp:64
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:34

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