AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
ASRProfile.h
Go to the documentation of this file.
1 /*
2  * Copyright 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 ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AIP_INCLUDE_AIP_ASRPROFILE_H_
17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AIP_INCLUDE_AIP_ASRPROFILE_H_
18 
19 #include <ostream>
20 
21 namespace alexaClientSDK {
22 namespace capabilityAgents {
23 namespace aip {
24 
25 #include <ostream>
26 
31 enum class ASRProfile {
33  CLOSE_TALK,
35  NEAR_FIELD,
37  FAR_FIELD,
39  UNDEFINED
40 };
41 
49 inline std::ostream& operator<<(std::ostream& stream, ASRProfile profile) {
50  switch (profile) {
52  stream << "CLOSE_TALK";
53  break;
55  stream << "NEAR_FIELD";
56  break;
58  stream << "FAR_FIELD";
59  break;
61  stream << "";
62  break;
63  }
64  return stream;
65 }
66 
74  switch (profile) {
76  return "CLOSE_TALK";
78  return "NEAR_FIELD";
80  return "FAR_FIELD";
82  return "";
83  }
84  return "";
85 }
86 
94 inline ASRProfile getASRProfile(const std::string& input) {
97  profile = ASRProfile::CLOSE_TALK;
98  } else if (asrProfileToString(ASRProfile::NEAR_FIELD) == input) {
99  profile = ASRProfile::NEAR_FIELD;
100  } else if (asrProfileToString(ASRProfile::FAR_FIELD) == input) {
101  profile = ASRProfile::FAR_FIELD;
102  }
103  return profile;
104 }
105 
106 } // namespace aip
107 } // namespace capabilityAgents
108 } // namespace alexaClientSDK
109 
110 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AIP_INCLUDE_AIP_ASRPROFILE_H_
::std::string string
Definition: gtest-port.h:1097
std::string asrProfileToString(ASRProfile profile)
Definition: ASRProfile.h:73
std::ostream & operator<<(std::ostream &stream, ASRProfile profile)
Definition: ASRProfile.h:49
ASRProfile
Definition: ASRProfile.h:31
ASRProfile getASRProfile(const std::string &input)
Definition: ASRProfile.h:94
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Indicates that ASR profile is undefined.
Cloud determines end of user speech (0 to 20+ ft).
Cloud determines end of user speech (0 to 5 ft).
Client determines end of user speech (0 to 2.5 ft).

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0