2017-05-18 05:02:48 +00:00
|
|
|
/*
|
2018-01-12 23:45:42 +00:00
|
|
|
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2017-05-18 05:02:48 +00:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
* A copy of the License is located at
|
|
|
|
*
|
|
|
|
* http://aws.amazon.com/apache2.0/
|
|
|
|
*
|
|
|
|
* or in the "license" file accompanying this file. This file is distributed
|
|
|
|
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
|
|
* express or implied. See the License for the specific language governing
|
|
|
|
* permissions and limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
/// @file AudioInputProcessorIntegrationTest.cpp
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
#include <chrono>
|
|
|
|
#include <deque>
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
#include <fstream>
|
|
|
|
#include <future>
|
2017-05-18 05:02:48 +00:00
|
|
|
#include <mutex>
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
#include <string>
|
2017-05-18 05:02:48 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <ACL/AVSConnectionManager.h>
|
|
|
|
#include <ADSL/DirectiveSequencer.h>
|
|
|
|
#include <ADSL/MessageInterpreter.h>
|
|
|
|
#include <AFML/Channel.h>
|
|
|
|
#include <AFML/FocusManager.h>
|
|
|
|
#include <AIP/AudioInputProcessor.h>
|
|
|
|
#include <AIP/AudioProvider.h>
|
|
|
|
#include <AIP/Initiator.h>
|
|
|
|
#include <AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h>
|
|
|
|
#include <AVSCommon/AVS/BlockingPolicy.h>
|
|
|
|
#include <AVSCommon/AVS/MessageRequest.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/ChannelObserverInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/DirectiveHandlerInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/DirectiveHandlerResultInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/ExceptionEncounteredSenderInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/KeyWordObserverInterface.h>
|
|
|
|
#include <AVSCommon/Utils/JSON/JSONUtils.h>
|
|
|
|
#include <AVSCommon/Utils/Logger/LogEntry.h>
|
|
|
|
|
|
|
|
#include "Integration/ACLTestContext.h"
|
2017-05-18 05:02:48 +00:00
|
|
|
#include "Integration/ObservableMessageRequest.h"
|
|
|
|
#include "Integration/AipStateObserver.h"
|
|
|
|
#include "Integration/TestMessageSender.h"
|
2017-06-23 23:26:34 +00:00
|
|
|
#include "Integration/TestDirectiveHandler.h"
|
|
|
|
#include "Integration/TestExceptionEncounteredSender.h"
|
2017-08-08 00:04:43 +00:00
|
|
|
#include "System/UserInactivityMonitor.h"
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// If the tests are created with both Kittai and Sensory, Kittai is chosen.
|
2017-05-18 05:02:48 +00:00
|
|
|
#ifdef KWD_KITTAI
|
|
|
|
#include "KittAi/KittAiKeyWordDetector.h"
|
2017-06-09 23:23:31 +00:00
|
|
|
#elif KWD_SENSORY
|
|
|
|
#include "Sensory/SensoryKeywordDetector.h"
|
2017-05-18 05:02:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace alexaClientSDK {
|
|
|
|
namespace integration {
|
2017-06-09 23:23:31 +00:00
|
|
|
namespace test {
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
using namespace alexaClientSDK::acl;
|
|
|
|
using namespace alexaClientSDK::adsl;
|
|
|
|
using namespace alexaClientSDK::avsCommon;
|
|
|
|
using namespace alexaClientSDK::avsCommon::avs;
|
2017-06-23 23:26:34 +00:00
|
|
|
using namespace alexaClientSDK::avsCommon::utils;
|
2017-05-26 23:06:14 +00:00
|
|
|
using namespace alexaClientSDK::avsCommon::avs::attachment;
|
2017-05-18 05:02:48 +00:00
|
|
|
using namespace alexaClientSDK::avsCommon::sdkInterfaces;
|
2017-06-09 23:23:31 +00:00
|
|
|
using namespace capabilityAgents::aip;
|
2017-08-08 00:04:43 +00:00
|
|
|
using namespace capabilityAgents::system;
|
2017-05-18 05:02:48 +00:00
|
|
|
using namespace sdkInterfaces;
|
|
|
|
using namespace avsCommon::utils::sds;
|
2017-06-23 23:26:34 +00:00
|
|
|
using namespace avsCommon::utils::json;
|
2017-05-18 05:02:48 +00:00
|
|
|
using namespace afml;
|
|
|
|
using namespace contextManager;
|
|
|
|
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Tell me a Joke" to be recognized.
|
|
|
|
static const std::string JOKE_AUDIO_FILE = "/recognize_joke_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Wikipedia" to be recognized.
|
|
|
|
static const std::string WIKI_AUDIO_FILE = "/recognize_wiki_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Lions" to be recognized.
|
|
|
|
static const std::string LIONS_AUDIO_FILE = "/recognize_lions_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of silence to be recognized.
|
|
|
|
static const std::string SILENCE_AUDIO_FILE = "/recognize_silence_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Alexa, Tell me a Joke" to be recognized.
|
|
|
|
static const std::string ALEXA_JOKE_AUDIO_FILE = "/alexa_recognize_joke_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Alexa, Wikipedia" to be recognized.
|
|
|
|
static const std::string ALEXA_WIKI_AUDIO_FILE = "/alexa_recognize_wiki_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Alexa" then silence to be recognized.
|
|
|
|
static const std::string ALEXA_SILENCE_AUDIO_FILE = "/alexa_recognize_silence_test.wav";
|
2018-03-09 00:55:39 +00:00
|
|
|
// This is a 32KHz little endian OPUS audio file with Constant Bit rate of "What time is it?" to be recognized.
|
|
|
|
static const std::string TIME_AUDIO_FILE_OPUS = "/utterance_time_success.opus";
|
2017-05-18 05:02:48 +00:00
|
|
|
// This string to be used for Speak Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_VOLUME_STATE = "VolumeState";
|
|
|
|
// This string to be used for Speak Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_SPEAK = "Speak";
|
|
|
|
// This string to be used for ExpectSpeech Directives which use the NAMESPACE_SPEECH_RECOGNIZER namespace.
|
|
|
|
static const std::string NAME_EXPECT_SPEECH = "ExpectSpeech";
|
|
|
|
// This string to be used for ExpectSpeechTimedOut Events which use the NAMESPACE_SPEECH_RECOGNIZER namespace.
|
|
|
|
static const std::string NAME_EXPECT_SPEECH_TIMED_OUT = "ExpectSpeechTimedOut";
|
|
|
|
// This string to be used for SetMute Directives which use the NAMESPACE_SPEAKER namespace.
|
|
|
|
static const std::string NAME_SET_MUTE = "SetMute";
|
|
|
|
// This string to be used for Play Directives which use the NAMESPACE_AUDIO_PLAYER namespace.
|
|
|
|
static const std::string NAME_PLAY = "Play";
|
|
|
|
// This string to be used for StopCapture Directives which use the NAMESPACE_SPEECH_RECOGNIZER namespace.
|
|
|
|
static const std::string NAME_STOP_CAPTURE = "StopCapture";
|
|
|
|
// This string to be used for Recognize Directives which use the NAMESPACE_SPEECH_RECOGNIZER namespace.
|
|
|
|
static const std::string NAME_RECOGNIZE = "Recognize";
|
|
|
|
// This String to be used to register the SpeechRecognizer namespace to a DirectiveHandler.
|
|
|
|
static const std::string NAMESPACE_SPEECH_RECOGNIZER = "SpeechRecognizer";
|
|
|
|
// This String to be used to register the SpeechSynthesizer namespace to a DirectiveHandler.
|
|
|
|
static const std::string NAMESPACE_SPEECH_SYNTHESIZER = "SpeechSynthesizer";
|
2017-06-23 23:26:34 +00:00
|
|
|
// This String to be used to register the AudioPlayer namespace to a DirectiveHandler.
|
2017-05-18 05:02:48 +00:00
|
|
|
static const std::string NAMESPACE_AUDIO_PLAYER = "AudioPlayer";
|
2017-06-23 23:26:34 +00:00
|
|
|
// This String to be used to register the Speaker namespace to a DirectiveHandler.
|
2017-05-18 05:02:48 +00:00
|
|
|
static const std::string NAMESPACE_SPEAKER = "Speaker";
|
|
|
|
// This pair connects a Speak name and SpeechSynthesizer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName SPEAK_PAIR = {NAMESPACE_SPEECH_SYNTHESIZER, NAME_SPEAK};
|
|
|
|
// This pair connects a ExpectSpeech name and SpeechRecognizer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName EXPECT_SPEECH_PAIR = {NAMESPACE_SPEECH_RECOGNIZER, NAME_EXPECT_SPEECH};
|
|
|
|
// This pair connects a SetMute name and Speaker namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName SET_MUTE_PAIR = {NAMESPACE_SPEAKER, NAME_SET_MUTE};
|
|
|
|
// This pair connects a SetMute name and Speaker namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName VOLUME_STATE_PAIR = {NAMESPACE_SPEAKER, NAME_VOLUME_STATE};
|
|
|
|
// This pair connects a Play name and AudioPlayer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName PLAY_PAIR = {NAMESPACE_AUDIO_PLAYER, NAME_PLAY};
|
|
|
|
// This pair connects a StopCapture name and SpeechRecognizer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName STOP_CAPTURE_PAIR = {NAMESPACE_SPEECH_RECOGNIZER, NAME_STOP_CAPTURE};
|
|
|
|
/// Sample dialog activity id.
|
|
|
|
static const std::string DIALOG_ACTIVITY_ID = "Dialog";
|
|
|
|
/// Sample alerts activity id.
|
|
|
|
static const std::string ALARM_ACTIVITY_ID = "Alarms";
|
|
|
|
/// Sample content activity id.
|
|
|
|
static const std::string CONTENT_ACTIVITY_ID = "Content";
|
|
|
|
|
2017-09-19 22:08:49 +00:00
|
|
|
// This Integer to be used to specify a timeout in seconds for long operations.
|
|
|
|
static const std::chrono::seconds LONG_TIMEOUT_DURATION(10);
|
2017-06-23 23:26:34 +00:00
|
|
|
// This Integer to be used when it is expected the duration will timeout but some wait time is still desired.
|
2017-09-19 22:08:49 +00:00
|
|
|
static const std::chrono::seconds SHORT_TIMEOUT_DURATION(2);
|
|
|
|
// This Integer to be used when no timeout is desired.
|
|
|
|
static const std::chrono::seconds NO_TIMEOUT_DURATION(0);
|
2018-03-09 00:55:39 +00:00
|
|
|
// The length of RIFF container format which is the header of a wav file.
|
|
|
|
static const int RIFF_HEADER_SIZE = 44;
|
|
|
|
/// The compatible sample rate for OPUS 32KHz.
|
|
|
|
static const unsigned int COMPATIBLE_SAMPLE_RATE_OPUS_32 = 32000;
|
2017-06-09 23:23:31 +00:00
|
|
|
#ifdef KWD_KITTAI
|
2017-05-18 05:02:48 +00:00
|
|
|
/// The name of the resource file required for Kitt.ai.
|
|
|
|
static const std::string RESOURCE_FILE = "/KittAiModels/common.res";
|
|
|
|
/// The name of the Alexa model file for Kitt.ai.
|
2017-06-23 23:26:34 +00:00
|
|
|
static const std::string MODEL_FILE = "/KittAiModels/alexa.umdl";
|
2017-05-18 05:02:48 +00:00
|
|
|
/// The keyword associated with alexa.umdl.
|
|
|
|
static const std::string MODEL_KEYWORD = "ALEXA";
|
2017-06-09 23:23:31 +00:00
|
|
|
#elif KWD_SENSORY
|
|
|
|
/// The name of the resource file required for Sensory
|
|
|
|
static const std::string RESOURCE_FILE = "/SensoryModels/spot-alexa-rpi-31000.snsr";
|
|
|
|
#endif
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
/// JSON key to get the directive object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_DIRECTIVE_KEY = "directive";
|
|
|
|
/// JSON key to get the header object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_HEADER_KEY = "header";
|
|
|
|
/// JSON key to get the namespace value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_NAMESPACE_KEY = "namespace";
|
|
|
|
/// JSON key to get the name value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_NAME_KEY = "name";
|
|
|
|
/// JSON key to get the messageId value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_MESSAGE_ID_KEY = "messageId";
|
|
|
|
/// JSON key to get the dialogRequestId value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId";
|
|
|
|
/// JSON key to get the payload object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_PAYLOAD_KEY = "payload";
|
|
|
|
|
|
|
|
/**
|
2017-06-23 23:26:34 +00:00
|
|
|
* The sensitivity to the keyword in the model. Set to 0.6 as this is what was described as optimal on the Kitt.ai
|
2017-05-18 05:02:48 +00:00
|
|
|
* Github page.
|
|
|
|
*/
|
|
|
|
#ifdef KWD_KITTAI
|
|
|
|
static const double KITTAI_SENSITIVITY = 0.6;
|
|
|
|
#endif
|
|
|
|
/// The compatible encoding for Kitt.ai.
|
2017-10-02 22:59:05 +00:00
|
|
|
static const avsCommon::utils::AudioFormat::Encoding COMPATIBLE_ENCODING =
|
|
|
|
avsCommon::utils::AudioFormat::Encoding::LPCM;
|
2017-05-18 05:02:48 +00:00
|
|
|
/// The compatible endianness for Kitt.ai.
|
2017-10-02 22:59:05 +00:00
|
|
|
static const avsCommon::utils::AudioFormat::Endianness COMPATIBLE_ENDIANNESS =
|
|
|
|
avsCommon::utils::AudioFormat::Endianness::LITTLE;
|
2017-05-18 05:02:48 +00:00
|
|
|
/// The compatible sample rate for Kitt.ai.
|
|
|
|
static const unsigned int COMPATIBLE_SAMPLE_RATE = 16000;
|
|
|
|
/// The compatible bits per sample for Kitt.ai.
|
|
|
|
static const unsigned int COMPATIBLE_SAMPLE_SIZE_IN_BITS = 16;
|
2017-06-23 23:26:34 +00:00
|
|
|
/// The compatible number of channels for Kitt.ai
|
2017-05-18 05:02:48 +00:00
|
|
|
static const unsigned int COMPATIBLE_NUM_CHANNELS = 1;
|
|
|
|
|
|
|
|
/// String to identify log entries originating from this file.
|
|
|
|
static const std::string TAG("AlexaDirectiveSequencerLibraryTest");
|
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
/// Path to the AlexaClientSDKConfig.json file (from command line arguments).
|
|
|
|
static std::string g_configPath;
|
|
|
|
/// Path to resources (e.g. audio files) for tests (from command line arguments).
|
|
|
|
static std::string g_inputPath;
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a LogEntry using this file's TAG and the specified event string.
|
|
|
|
*
|
|
|
|
* @param The event string for this @c LogEntry.
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
#define LX(event) ::alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
class tapToTalkButton {
|
|
|
|
public:
|
2017-05-18 05:02:48 +00:00
|
|
|
bool startRecognizing(std::shared_ptr<AudioInputProcessor> aip, std::shared_ptr<AudioProvider> audioProvider) {
|
|
|
|
return aip->recognize(*audioProvider, Initiator::TAP).get();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
class holdToTalkButton {
|
2017-05-18 05:02:48 +00:00
|
|
|
public:
|
2017-10-02 22:59:05 +00:00
|
|
|
bool startRecognizing(std::shared_ptr<AudioInputProcessor> aip, std::shared_ptr<AudioProvider> audioProvider) {
|
2017-05-18 05:02:48 +00:00
|
|
|
return aip->recognize(*audioProvider, Initiator::PRESS_AND_HOLD).get();
|
|
|
|
}
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
bool stopRecognizing(std::shared_ptr<AudioInputProcessor> aip) {
|
2017-05-18 05:02:48 +00:00
|
|
|
return aip->stopCapture().get();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-10-02 22:59:05 +00:00
|
|
|
class wakeWordTrigger : public KeyWordObserverInterface {
|
|
|
|
public:
|
|
|
|
wakeWordTrigger(AudioFormat compatibleAudioFormat, std::shared_ptr<AudioInputProcessor> aip) {
|
|
|
|
m_compatibleAudioFormat = compatibleAudioFormat;
|
|
|
|
m_aip = aip;
|
|
|
|
}
|
2017-05-18 05:02:48 +00:00
|
|
|
void onKeyWordDetected(
|
|
|
|
std::shared_ptr<AudioInputStream> stream,
|
|
|
|
std::string keyword,
|
|
|
|
AudioInputStream::Index beginIndex,
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
AudioInputStream::Index endIndex,
|
|
|
|
std::shared_ptr<const std::vector<char>> KWDMetadata = nullptr) {
|
2017-10-02 22:59:05 +00:00
|
|
|
keyWordDetected = true;
|
|
|
|
ASSERT_NE(nullptr, stream);
|
|
|
|
bool alwaysReadable = true;
|
|
|
|
bool canOverride = false;
|
|
|
|
bool canBeOverridden = true;
|
|
|
|
auto audioProvider = AudioProvider(
|
|
|
|
stream, m_compatibleAudioFormat, ASRProfile::NEAR_FIELD, alwaysReadable, !canOverride, canBeOverridden);
|
|
|
|
|
|
|
|
if (m_aip) {
|
|
|
|
AudioInputStream::Index aipBegin = AudioInputProcessor::INVALID_INDEX;
|
|
|
|
AudioInputStream::Index aipEnd = AudioInputProcessor::INVALID_INDEX;
|
|
|
|
|
|
|
|
if (endIndex != KeyWordObserverInterface::UNSPECIFIED_INDEX) {
|
|
|
|
if (beginIndex != KeyWordObserverInterface::UNSPECIFIED_INDEX) {
|
|
|
|
// If we know where the keyword starts and ends, pass both of those along to AIP.
|
|
|
|
aipBegin = beginIndex;
|
|
|
|
aipEnd = endIndex;
|
|
|
|
} else {
|
|
|
|
// If we only know where the keyword ends, AIP should begin recording there.
|
|
|
|
aipBegin = endIndex;
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
}
|
|
|
|
// Else we don't have any indices to pass along; AIP will begin recording ASAP.
|
2017-06-09 23:23:31 +00:00
|
|
|
#ifdef KWD_KITTAI
|
2017-10-02 22:59:05 +00:00
|
|
|
m_aip->recognize(audioProvider, Initiator::TAP, aipBegin, aipEnd, keyword);
|
2017-06-09 23:23:31 +00:00
|
|
|
#elif KWD_SENSORY
|
2017-10-02 22:59:05 +00:00
|
|
|
m_aip->recognize(audioProvider, Initiator::WAKEWORD, aipBegin, aipEnd, keyword);
|
2017-06-09 23:23:31 +00:00
|
|
|
#endif
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
}
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
bool keyWordDetected = false;
|
2017-05-18 05:02:48 +00:00
|
|
|
AudioFormat m_compatibleAudioFormat;
|
2017-06-23 23:26:34 +00:00
|
|
|
std::shared_ptr<AudioInputProcessor> m_aip;
|
2017-05-18 05:02:48 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
class testStateProvider
|
|
|
|
: public StateProviderInterface
|
|
|
|
, public RequiresShutdown {
|
2017-06-23 23:26:34 +00:00
|
|
|
public:
|
2017-09-19 22:08:49 +00:00
|
|
|
testStateProvider(std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager) :
|
|
|
|
RequiresShutdown("testStateProvider") {
|
2017-05-18 05:02:48 +00:00
|
|
|
m_contextManager = contextManager;
|
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
~testStateProvider() {
|
2017-09-19 22:08:49 +00:00
|
|
|
}
|
2017-12-09 00:07:37 +00:00
|
|
|
void provideState(const NamespaceAndName& nsname, const unsigned int stateRequestToken) override {
|
2017-05-18 05:02:48 +00:00
|
|
|
std::ostringstream context;
|
|
|
|
context << R"({)"
|
2017-10-02 22:59:05 +00:00
|
|
|
R"("volume":)"
|
|
|
|
<< 50 << R"(,)"
|
|
|
|
<< R"("muted":)" << false << R"(})";
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
m_contextManager->setState(
|
|
|
|
VOLUME_STATE_PAIR, context.str(), avsCommon::avs::StateRefreshPolicy::ALWAYS, stateRequestToken);
|
2017-05-18 05:02:48 +00:00
|
|
|
m_stateRequested = true;
|
|
|
|
}
|
|
|
|
bool checkStateRequested() {
|
2017-06-23 23:26:34 +00:00
|
|
|
bool savedResult = false;
|
|
|
|
if (m_stateRequested) {
|
2017-05-18 05:02:48 +00:00
|
|
|
savedResult = true;
|
2017-06-23 23:26:34 +00:00
|
|
|
m_stateRequested = false;
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-06-23 23:26:34 +00:00
|
|
|
return savedResult;
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
protected:
|
|
|
|
void doShutdown() override {
|
|
|
|
m_contextManager.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_stateRequested = false;
|
|
|
|
std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> m_contextManager;
|
2017-05-18 05:02:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// A test observer that mocks out the ChannelObserverInterface##onFocusChanged() call.
|
|
|
|
class TestClient : public ChannelObserverInterface {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
TestClient() : m_focusState(FocusState::NONE) {
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of the ChannelObserverInterface##onFocusChanged() callback.
|
|
|
|
*
|
|
|
|
* @param focusState The new focus state of the Channel observer.
|
|
|
|
*/
|
|
|
|
void onFocusChanged(FocusState focusState) override {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
m_queue.push_back(focusState);
|
|
|
|
m_focusState = focusState;
|
|
|
|
m_wakeTrigger.notify_all();
|
|
|
|
}
|
2017-06-23 23:26:34 +00:00
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
/**
|
|
|
|
* Waits for the ChannelObserverInterface##onFocusChanged() callback.
|
|
|
|
*
|
|
|
|
* @param timeout The amount of time to wait for the callback.
|
|
|
|
* @param focusChanged An output parameter that notifies the caller whether a callback occurred.
|
|
|
|
* @return Returns @c true if the callback occured within the timeout period and @c false otherwise.
|
|
|
|
*/
|
|
|
|
FocusState waitForFocusChange(std::chrono::milliseconds timeout) {
|
|
|
|
FocusState ret;
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
if (!m_wakeTrigger.wait_for(lock, timeout, [this]() { return !m_queue.empty(); })) {
|
|
|
|
ret = FocusState::NONE;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = m_queue.front();
|
|
|
|
m_queue.pop_front();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// The focus state of the observer.
|
|
|
|
FocusState m_focusState;
|
|
|
|
|
|
|
|
/// A lock to guard against focus state changes.
|
|
|
|
std::mutex m_mutex;
|
|
|
|
|
|
|
|
/// Trigger to wake up waitForNext calls.
|
|
|
|
std::condition_variable m_wakeTrigger;
|
|
|
|
/// Queue of received directives that have not been waited on.
|
|
|
|
std::deque<FocusState> m_queue;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AudioInputProcessorTest : public ::testing::Test {
|
|
|
|
protected:
|
|
|
|
void SetUp() override {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context = ACLTestContext::create(g_configPath);
|
|
|
|
ASSERT_TRUE(m_context);
|
|
|
|
|
2017-06-09 23:23:31 +00:00
|
|
|
m_exceptionEncounteredSender = std::make_shared<TestExceptionEncounteredSender>();
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
DirectiveHandlerConfiguration handlerConfig;
|
|
|
|
handlerConfig[SET_MUTE_PAIR] = BlockingPolicy::NON_BLOCKING;
|
|
|
|
handlerConfig[SPEAK_PAIR] = BlockingPolicy::BLOCKING;
|
|
|
|
m_directiveHandler = std::make_shared<TestDirectiveHandler>(handlerConfig);
|
|
|
|
|
2017-06-09 23:23:31 +00:00
|
|
|
m_directiveSequencer = DirectiveSequencer::create(m_exceptionEncounteredSender);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(nullptr, m_directiveSequencer);
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_messageInterpreter = std::make_shared<MessageInterpreter>(
|
|
|
|
m_exceptionEncounteredSender, m_directiveSequencer, m_context->getAttachmentManager());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
m_compatibleAudioFormat.sampleRateHz = COMPATIBLE_SAMPLE_RATE;
|
|
|
|
m_compatibleAudioFormat.sampleSizeInBits = COMPATIBLE_SAMPLE_SIZE_IN_BITS;
|
|
|
|
m_compatibleAudioFormat.numChannels = COMPATIBLE_NUM_CHANNELS;
|
|
|
|
m_compatibleAudioFormat.endianness = COMPATIBLE_ENDIANNESS;
|
|
|
|
m_compatibleAudioFormat.encoding = COMPATIBLE_ENCODING;
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
size_t nWords = 1024 * 1024;
|
2017-05-18 05:02:48 +00:00
|
|
|
size_t wordSize = 2;
|
|
|
|
size_t maxReaders = 3;
|
|
|
|
size_t bufferSize = AudioInputStream::calculateBufferSize(nWords, wordSize, maxReaders);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
auto m_Buffer = std::make_shared<avsCommon::avs::AudioInputStream::Buffer>(bufferSize);
|
|
|
|
auto m_Sds = avsCommon::avs::AudioInputStream::create(m_Buffer, wordSize, maxReaders);
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_NE(nullptr, m_Sds);
|
2017-05-18 05:02:48 +00:00
|
|
|
m_AudioBuffer = std::move(m_Sds);
|
2017-10-02 22:59:05 +00:00
|
|
|
m_AudioBufferWriter =
|
|
|
|
m_AudioBuffer->createWriter(avsCommon::avs::AudioInputStream::Writer::Policy::NONBLOCKABLE);
|
|
|
|
ASSERT_NE(nullptr, m_AudioBufferWriter);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Set up tap and hold to talk buttons.
|
|
|
|
bool alwaysReadable = true;
|
|
|
|
bool canOverride = true;
|
|
|
|
bool canBeOverridden = true;
|
2017-10-02 22:59:05 +00:00
|
|
|
m_HoldToTalkAudioProvider = std::make_shared<AudioProvider>(
|
|
|
|
m_AudioBuffer,
|
|
|
|
m_compatibleAudioFormat,
|
|
|
|
ASRProfile::CLOSE_TALK,
|
|
|
|
!alwaysReadable,
|
|
|
|
canOverride,
|
|
|
|
!canBeOverridden);
|
|
|
|
m_TapToTalkAudioProvider = std::make_shared<AudioProvider>(
|
|
|
|
m_AudioBuffer,
|
|
|
|
m_compatibleAudioFormat,
|
|
|
|
ASRProfile::NEAR_FIELD,
|
|
|
|
alwaysReadable,
|
|
|
|
canOverride,
|
|
|
|
!canBeOverridden);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
m_tapToTalkButton = std::make_shared<tapToTalkButton>();
|
|
|
|
m_holdToTalkButton = std::make_shared<holdToTalkButton>();
|
Version 1.8 alexa-client-sdk
Changes in this update:
Enhancements
Added local stop functionality. This allows a user to stop an active function, such as an alert or timer, by uttering "Alexa, stop" when an Alexa-enabled product is offline.
Alerts in the background now stream in 10 sec intervals, rather than continuously.
Added support for France to the sample app.
friendlyName can now be updated for BlueZ implementations of BlueZBluetoothDevice and BlueZHostController.
Bug Fixes
Fixed an issue where the Bluetooth agent didn't clear user data upon reset, including paired devices and the uuidMapping table.
Fixed MediaPlayer threading issues. Now each instance has it's own glib main loop thread, rather than utilizing the default main context worker thread.
Fixed segmentation fault issues that occurred when certain static initializers needed to be initialized in a certain order, but the order wasn't defined.
Known Issues
The ACL may encounter issues if audio attachments are received but not consumed.
SpeechSynthesizerState currently uses GAINING_FOCUS and LOSING_FOCUS as a workaround for handling intermediate state. These states may be removed in a future release.
The Alexa app doesn't always indicate when a device is successfully connected via Bluetooth.
Connecting a product to streaming media via Bluetooth will sometimes stop media playback within the source application. Resuming playback through the source application or toggling next/previous will correct playback.
When a source device is streaming silence via Bluetooth, the Alexa companion app indicates that audio content is streaming.
The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation is not yet supported.
On some products, interrupted Bluetooth playback may not resume if other content is locally streamed.
On Raspberry Pi, when streaming audio via Bluetooth, sometimes the audio stream stutters.
On Raspberry Pi, BlueALSA must be terminated each time the device boots. See Raspberry Pi Quick Start Guide for more information.
2018-06-27 21:41:15 +00:00
|
|
|
m_focusManager = std::make_shared<FocusManager>(FocusManager::getDefaultAudioChannels());
|
2017-07-18 22:25:37 +00:00
|
|
|
m_dialogUXStateAggregator = std::make_shared<avsCommon::avs::DialogUXStateAggregator>();
|
2017-05-18 05:02:48 +00:00
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_stateProvider = std::make_shared<testStateProvider>(m_context->getContextManager());
|
|
|
|
ASSERT_TRUE(m_context->getContextManager());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->getContextManager()->setStateProvider(VOLUME_STATE_PAIR, m_stateProvider);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Set up connection and connect
|
|
|
|
m_avsConnectionManager = std::make_shared<TestMessageSender>(
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->getMessageRouter(), false, m_context->getConnectionStatusObserver(), m_messageInterpreter);
|
|
|
|
ASSERT_TRUE(m_avsConnectionManager);
|
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
connect();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
m_userInactivityMonitor = UserInactivityMonitor::create(m_avsConnectionManager, m_exceptionEncounteredSender);
|
2017-05-18 05:02:48 +00:00
|
|
|
m_AudioInputProcessor = AudioInputProcessor::create(
|
|
|
|
m_directiveSequencer,
|
2017-06-23 23:26:34 +00:00
|
|
|
m_avsConnectionManager,
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->getContextManager(),
|
2017-06-23 23:26:34 +00:00
|
|
|
m_focusManager,
|
2017-07-18 22:25:37 +00:00
|
|
|
m_dialogUXStateAggregator,
|
2017-08-08 00:04:43 +00:00
|
|
|
m_exceptionEncounteredSender,
|
2017-10-02 22:59:05 +00:00
|
|
|
m_userInactivityMonitor);
|
|
|
|
ASSERT_NE(nullptr, m_AudioInputProcessor);
|
2017-07-18 22:25:37 +00:00
|
|
|
m_AudioInputProcessor->addObserver(m_dialogUXStateAggregator);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
m_testClient = std::make_shared<TestClient>();
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_TRUE(m_focusManager->acquireChannel(FocusManager::ALERTS_CHANNEL_NAME, m_testClient, ALARM_ACTIVITY_ID));
|
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
m_StateObserver = std::make_shared<AipStateObserver>();
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_NE(nullptr, m_StateObserver);
|
2017-05-18 05:02:48 +00:00
|
|
|
m_AudioInputProcessor->addObserver(m_StateObserver);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_directiveSequencer->addDirectiveHandler(m_AudioInputProcessor));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
m_wakeWordTrigger = std::make_shared<wakeWordTrigger>(m_compatibleAudioFormat, m_AudioInputProcessor);
|
|
|
|
|
|
|
|
#ifdef KWD_KITTAI
|
|
|
|
kwd::KittAiKeyWordDetector::KittAiConfiguration config;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
config = {g_inputPath + MODEL_FILE, MODEL_KEYWORD, KITTAI_SENSITIVITY};
|
2017-05-18 05:02:48 +00:00
|
|
|
m_detector = kwd::KittAiKeyWordDetector::create(
|
2017-10-02 22:59:05 +00:00
|
|
|
m_AudioBuffer,
|
|
|
|
m_compatibleAudioFormat,
|
|
|
|
{m_wakeWordTrigger},
|
|
|
|
// Not using an empty initializer list here to account for a GCC 4.9.2 regression
|
|
|
|
std::unordered_set<std::shared_ptr<KeyWordDetectorStateObserverInterface>>(),
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
g_inputPath + RESOURCE_FILE,
|
2017-10-02 22:59:05 +00:00
|
|
|
{config},
|
|
|
|
2.0,
|
|
|
|
false);
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_detector);
|
2017-06-09 23:23:31 +00:00
|
|
|
#elif KWD_SENSORY
|
|
|
|
m_detector = kwd::SensoryKeywordDetector::create(
|
2017-10-02 22:59:05 +00:00
|
|
|
m_AudioBuffer,
|
|
|
|
m_compatibleAudioFormat,
|
|
|
|
{m_wakeWordTrigger},
|
|
|
|
// Not using an empty initializer list here to account for a GCC 4.9.2 regression
|
|
|
|
std::unordered_set<std::shared_ptr<KeyWordDetectorStateObserverInterface>>(),
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
g_inputPath + RESOURCE_FILE);
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_detector);
|
|
|
|
#endif
|
2017-05-18 05:02:48 +00:00
|
|
|
#endif
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_directiveSequencer->addDirectiveHandler(m_directiveHandler));
|
2017-09-19 22:08:49 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, NO_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
2017-09-19 22:08:49 +00:00
|
|
|
void TearDown() override {
|
2017-05-18 05:02:48 +00:00
|
|
|
disconnect();
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
// Note that these nullptr checks are needed to avoid segaults if @c SetUp() failed.
|
|
|
|
if (m_AudioInputProcessor) {
|
|
|
|
m_AudioInputProcessor->shutdown();
|
|
|
|
}
|
|
|
|
if (m_directiveSequencer) {
|
|
|
|
m_directiveSequencer->shutdown();
|
|
|
|
}
|
|
|
|
if (m_avsConnectionManager) {
|
|
|
|
m_avsConnectionManager->shutdown();
|
|
|
|
}
|
|
|
|
if (m_stateProvider) {
|
|
|
|
m_stateProvider->shutdown();
|
|
|
|
}
|
|
|
|
if (m_userInactivityMonitor) {
|
|
|
|
m_userInactivityMonitor->shutdown();
|
|
|
|
}
|
|
|
|
m_context.reset();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Connect to AVS.
|
|
|
|
*/
|
|
|
|
void connect() {
|
|
|
|
m_avsConnectionManager->enable();
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->waitForConnected();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disconnect from AVS.
|
|
|
|
*/
|
|
|
|
void disconnect() {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
if (m_avsConnectionManager) {
|
|
|
|
m_avsConnectionManager->disable();
|
|
|
|
m_context->waitForDisconnected();
|
|
|
|
}
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
bool checkSentEventName(std::shared_ptr<TestMessageSender> connectionManager, std::string expectedName) {
|
2017-09-19 22:08:49 +00:00
|
|
|
TestMessageSender::SendParams sendParams = connectionManager->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
if (TestMessageSender::SendParams::Type::SEND == sendParams.type) {
|
|
|
|
std::string eventString;
|
|
|
|
std::string eventHeader;
|
|
|
|
std::string eventName;
|
2017-10-30 22:14:38 +00:00
|
|
|
jsonUtils::retrieveValue(sendParams.request->getJsonContent(), "event", &eventString);
|
|
|
|
jsonUtils::retrieveValue(eventString, "header", &eventHeader);
|
|
|
|
jsonUtils::retrieveValue(eventHeader, "name", &eventName);
|
2017-06-23 23:26:34 +00:00
|
|
|
if (eventName == expectedName) {
|
|
|
|
return true;
|
|
|
|
} else {
|
2017-05-18 05:02:48 +00:00
|
|
|
return false;
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
|
|
|
} else {
|
2017-05-18 05:02:48 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
/// Context for running ACL based tests.
|
|
|
|
std::unique_ptr<ACLTestContext> m_context;
|
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<TestMessageSender> m_avsConnectionManager;
|
|
|
|
std::shared_ptr<TestDirectiveHandler> m_directiveHandler;
|
2017-06-09 23:23:31 +00:00
|
|
|
std::shared_ptr<TestExceptionEncounteredSender> m_exceptionEncounteredSender;
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<DirectiveSequencerInterface> m_directiveSequencer;
|
|
|
|
std::shared_ptr<MessageInterpreter> m_messageInterpreter;
|
|
|
|
std::shared_ptr<afml::FocusManager> m_focusManager;
|
2017-07-18 22:25:37 +00:00
|
|
|
std::shared_ptr<avsCommon::avs::DialogUXStateAggregator> m_dialogUXStateAggregator;
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<TestClient> m_testClient;
|
2017-08-08 00:04:43 +00:00
|
|
|
std::shared_ptr<UserInactivityMonitor> m_userInactivityMonitor;
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<AudioInputProcessor> m_AudioInputProcessor;
|
|
|
|
std::shared_ptr<AipStateObserver> m_StateObserver;
|
|
|
|
std::shared_ptr<tapToTalkButton> m_tapToTalkButton;
|
|
|
|
std::shared_ptr<holdToTalkButton> m_holdToTalkButton;
|
|
|
|
std::shared_ptr<testStateProvider> m_stateProvider;
|
|
|
|
std::unique_ptr<AudioInputStream::Writer> m_AudioBufferWriter;
|
|
|
|
std::shared_ptr<AudioInputStream> m_AudioBuffer;
|
|
|
|
std::shared_ptr<AudioProvider> m_TapToTalkAudioProvider;
|
|
|
|
std::shared_ptr<AudioProvider> m_HoldToTalkAudioProvider;
|
2017-06-23 23:26:34 +00:00
|
|
|
avsCommon::utils::AudioFormat m_compatibleAudioFormat;
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<wakeWordTrigger> m_wakeWordTrigger;
|
|
|
|
#ifdef KWD_KITTAI
|
|
|
|
std::unique_ptr<kwd::KittAiKeyWordDetector> m_detector;
|
2017-06-09 23:23:31 +00:00
|
|
|
#elif KWD_SENSORY
|
|
|
|
std::unique_ptr<kwd::SensoryKeywordDetector> m_detector;
|
|
|
|
#endif
|
2017-05-18 05:02:48 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
template <typename T>
|
|
|
|
std::vector<T> readAudioFromFile(const std::string& fileName, const int& headerPosition, bool* errorOccurred) {
|
2017-05-18 05:02:48 +00:00
|
|
|
std::ifstream inputFile(fileName.c_str(), std::ifstream::binary);
|
|
|
|
if (!inputFile.good()) {
|
|
|
|
std::cout << "Couldn't open audio file!" << std::endl;
|
|
|
|
if (errorOccurred) {
|
|
|
|
*errorOccurred = true;
|
|
|
|
}
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
inputFile.seekg(0, std::ios::end);
|
|
|
|
int fileLengthInBytes = inputFile.tellg();
|
2018-03-09 00:55:39 +00:00
|
|
|
|
|
|
|
if (fileLengthInBytes <= headerPosition) {
|
|
|
|
std::cout << "File should be larger than header position" << std::endl;
|
2017-05-18 05:02:48 +00:00
|
|
|
if (errorOccurred) {
|
|
|
|
*errorOccurred = true;
|
|
|
|
}
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
inputFile.seekg(headerPosition, std::ios::beg);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
int numSamples = (fileLengthInBytes - headerPosition) / sizeof(T);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<T> retVal(numSamples, 0);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
inputFile.read((char*)&retVal[0], numSamples * sizeof(T));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
if (static_cast<size_t>(inputFile.gcount()) != numSamples * sizeof(T)) {
|
2017-05-18 05:02:48 +00:00
|
|
|
std::cout << "Error reading audio file" << std::endl;
|
|
|
|
if (errorOccurred) {
|
|
|
|
*errorOccurred = true;
|
|
|
|
}
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
inputFile.close();
|
|
|
|
if (errorOccurred) {
|
|
|
|
*errorOccurred = false;
|
|
|
|
}
|
|
|
|
return retVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a simple interation triggered by a wakeword.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Alexa, tell me a joke" is fed into a stream that is being read by a wake word engine. The
|
2017-10-02 22:59:05 +00:00
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute and Speak
|
|
|
|
* directive.
|
2017-05-18 05:02:48 +00:00
|
|
|
*/
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-06-23 23:26:34 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, wakeWordJoke) {
|
2017-05-18 05:02:48 +00:00
|
|
|
// Put audio onto the SDS saying "Alexa, Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + ALEXA_JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params =
|
|
|
|
m_directiveHandler->waitForNext(std::chrono::seconds(LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a recognize triggered by a wakeword followed by silence .
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Alexa, ........." is fed into a stream that is being read by a wake word engine. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with no directives.
|
|
|
|
*/
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, wakeWordSilence) {
|
|
|
|
// Put audio onto the SDS saying "Alexa ......".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + ALEXA_SILENCE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that no prehandle or handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a wakeword.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Alexa, wikipedia" is fed into a stream that is being read by a wake word engine. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
2017-05-18 05:02:48 +00:00
|
|
|
* and ExpectSpeech directive. Audio of "Lions" is then fed into the stream and another recognize event is sent.
|
|
|
|
*/
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, wakeWordMultiturn) {
|
|
|
|
// Put audio onto the SDS saying "Alexa, wikipedia".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + ALEXA_WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params =
|
|
|
|
m_directiveHandler->waitForNext(std::chrono::seconds(LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Lions".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string secondFile = g_inputPath + LIONS_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(secondFile, RIFF_HEADER_SIZE, &secondError);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a simple interation triggered by a wakeword but no user response.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Alexa, wikipedia" is fed into a stream that is being read by a wake word engine. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
|
|
|
* and ExpectSpeech directive. Audio of "...." is then fed into the stream and another recognize event is sent
|
2017-05-18 05:02:48 +00:00
|
|
|
* but no directives are given in response.
|
|
|
|
*/
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, wakeWordMultiturnWithoutUserResponse) {
|
|
|
|
// Put audio onto the SDS saying "Alexa, wikipedia".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + ALEXA_WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS
|
|
|
|
TestDirectiveHandler::DirectiveParams params =
|
|
|
|
m_directiveHandler->waitForNext(std::chrono::seconds(LONG_TIMEOUT_DURATION));
|
2017-06-23 23:26:34 +00:00
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying ".......".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string secondFile = g_inputPath + SILENCE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(secondFile, RIFF_HEADER_SIZE, &secondError);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was not sent.
|
|
|
|
ASSERT_FALSE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_FALSE(m_stateProvider->checkStateRequested());
|
|
|
|
|
2017-09-19 22:08:49 +00:00
|
|
|
// The test channel client has not changed.
|
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a simple interation triggered by a tap to talk button.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* To do this, audio of "Tell me a joke" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute and Speak
|
2017-06-23 23:26:34 +00:00
|
|
|
* directive.
|
2017-05-18 05:02:48 +00:00
|
|
|
*/
|
2018-01-12 23:45:42 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, DISABLED_tapToTalkJoke) {
|
2017-05-18 05:02:48 +00:00
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-09 00:55:39 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkTimeOpus) {
|
|
|
|
m_compatibleAudioFormat.sampleRateHz = COMPATIBLE_SAMPLE_RATE_OPUS_32;
|
|
|
|
m_compatibleAudioFormat.numChannels = COMPATIBLE_NUM_CHANNELS;
|
|
|
|
m_compatibleAudioFormat.endianness = COMPATIBLE_ENDIANNESS;
|
|
|
|
m_compatibleAudioFormat.encoding = avsCommon::utils::AudioFormat::Encoding::OPUS;
|
|
|
|
|
|
|
|
bool alwaysReadable = true;
|
|
|
|
bool canOverride = true;
|
|
|
|
bool canBeOverridden = true;
|
|
|
|
std::shared_ptr<AudioProvider> tapToTalkAudioProvider;
|
|
|
|
tapToTalkAudioProvider = std::make_shared<AudioProvider>(
|
|
|
|
m_AudioBuffer, m_compatibleAudioFormat, ASRProfile::NEAR_FIELD, alwaysReadable, canOverride, !canBeOverridden);
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, tapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
|
|
|
|
|
|
|
// Put audio onto the SDS saying "What time is it?".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + TIME_AUDIO_FILE_OPUS;
|
2018-03-09 00:55:39 +00:00
|
|
|
int headerSize = 0;
|
|
|
|
std::vector<uint8_t> audioData = readAudioFromFile<uint8_t>(file, headerSize, &error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
}
|
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a silent interation triggered by a tap to talk button.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "....." is fed into a stream after button sends recognize to AudioInputProcessor. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds no directives.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkSilence) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying ".......".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + SILENCE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that no directives arrived to the fake SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle no audio being written triggered by a tap to talk button.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, no audio is fed into a stream after button sends recognize to AudioInputProcessor. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with no directive.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkNoAudio) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Put no audio onto the SDS.
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has not changed.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that no directives arrived to the fake SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle an interation triggered by a tap to talk button with wake word.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* To do this, audio of "Alexa, Tell me a joke" is fed into a stream after button sends recognize to
|
2017-06-23 23:26:34 +00:00
|
|
|
* AudioInputProcessor. The AudioInputProcessor is then observed to send only one Recognize event to AVS which responds
|
|
|
|
* with a SetMute and Speak directive.
|
2017-05-18 05:02:48 +00:00
|
|
|
*/
|
2018-03-09 00:55:39 +00:00
|
|
|
#if defined(KWD_KITTAI) || defined(KWD_SENSORY)
|
2017-05-18 05:02:48 +00:00
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkWithWakeWordConflict) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Alexa, Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + ALEXA_JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a tap to talk button.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Wikipedia" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
2017-05-18 05:02:48 +00:00
|
|
|
* and ExpectSpeech directive. Audio of "Lions" is then fed into the stream and another recognize event is sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkMultiturn) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Wikipedia".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, SHORT_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, SHORT_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Lions".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string secondFile = g_inputPath + LIONS_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(secondFile, RIFF_HEADER_SIZE, &secondError);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-10-02 22:59:05 +00:00
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a tap to talk button but no user
|
2017-06-23 23:26:34 +00:00
|
|
|
* response.
|
2017-05-18 05:02:48 +00:00
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Wikipedia" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
|
|
|
* and ExpectSpeech directive. Audio of "...." is then fed into the stream and another recognize event is sent
|
2017-05-18 05:02:48 +00:00
|
|
|
* but no directives are given in response.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkMultiturnWithoutUserResponse) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Wikipedia".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
bool expectSpeechFound = true;
|
2017-06-23 23:26:34 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params;
|
2017-10-02 22:59:05 +00:00
|
|
|
while (expectSpeechFound) {
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is in an IDLE state before starting.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
2017-10-02 22:59:05 +00:00
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, SHORT_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Put audio onto the SDS saying ".......".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string secondFile = g_inputPath + SILENCE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(secondFile, RIFF_HEADER_SIZE, &secondError);
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_FALSE(m_stateProvider->checkStateRequested());
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
expectSpeechFound = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// The test channel client has not changed.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was not sent.
|
|
|
|
ASSERT_FALSE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that no directives arrived to the fake SS.
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a cancel partway through an interaction.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Tell me a joke" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* button then sends a reset command and no recognize event is sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, tapToTalkCancel) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_tapToTalkButton->startRecognizing(m_AudioInputProcessor, m_TapToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Cancel the interaction.
|
|
|
|
m_AudioInputProcessor->resetState();
|
|
|
|
|
|
|
|
// Check that AIP was briefly in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that no directives arrived to the fake SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a simple interation triggered by a hold to talk button.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* To do this, audio of "Tell me a joke" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute and Speak
|
2017-06-23 23:26:34 +00:00
|
|
|
* directive.
|
2017-05-18 05:02:48 +00:00
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkJoke) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_NE(nullptr, m_HoldToTalkAudioProvider);
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a hold to talk button.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Wikipedia" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
2017-05-18 05:02:48 +00:00
|
|
|
* and ExpectSpeech directive. Audio of "Lions" is then fed into the stream and another recognize event is sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkMultiturn) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Put audio onto the SDS saying "Wikipedia".
|
2017-05-18 05:02:48 +00:00
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, LONG_TIMEOUT_DURATION));
|
2017-06-23 23:26:34 +00:00
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Put audio onto the SDS of "Lions".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
file = g_inputPath + LIONS_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &secondError);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-10-02 22:59:05 +00:00
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a hold to talk button but no user
|
|
|
|
* response.
|
2017-05-18 05:02:48 +00:00
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Wikipedia" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
|
|
|
* and ExpectSpeech directive. Audio of "...." is then fed into the stream and another recognize event is sent
|
2017-05-18 05:02:48 +00:00
|
|
|
* but no directives are given in response.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkMultiTurnWithSilence) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Put audio onto the SDS saying "Wikipedia".
|
2017-05-18 05:02:48 +00:00
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
bool expectSpeechFound = true;
|
2017-06-23 23:26:34 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params;
|
2017-10-02 22:59:05 +00:00
|
|
|
while (expectSpeechFound) {
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is in an IDLE state before starting.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
2017-09-19 22:08:49 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
2017-10-02 22:59:05 +00:00
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, SHORT_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-09-19 22:08:49 +00:00
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Put audio onto the SDS saying ".......".
|
|
|
|
bool secondError;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string secondFile = g_inputPath + SILENCE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> secondAudioData = readAudioFromFile<int16_t>(secondFile, RIFF_HEADER_SIZE, &secondError);
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_FALSE(secondError);
|
|
|
|
m_AudioBufferWriter->write(secondAudioData.data(), secondAudioData.size());
|
2017-10-02 22:59:05 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(NO_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_FALSE(m_stateProvider->checkStateRequested());
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
expectSpeechFound = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// The test channel client has not changed.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was not sent.
|
|
|
|
ASSERT_FALSE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that no directives arrived to the fake SS.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-10-02 22:59:05 +00:00
|
|
|
* Test AudioInputProcessor's ability to handle a multiturn interation triggered by a hold to talk button that times
|
|
|
|
* out.
|
2017-05-18 05:02:48 +00:00
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Wikipedia" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with a SetMute, Speak,
|
|
|
|
* and ExpectSpeech directive. The button does not trigger another recognize so no recognize event is sent
|
2017-05-18 05:02:48 +00:00
|
|
|
* and no directives are given in response. ExpectSpeechTimedOut event is observed to be sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkMultiturnWithTimeOut) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Wikipedia".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + WIKI_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that a recognize event was sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Check that prehandle and handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(LONG_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.isHandle() && params.directive->getName() == NAME_SPEAK) {
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
2017-10-02 22:59:05 +00:00
|
|
|
params.result->setCompleted();
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
2017-09-19 22:08:49 +00:00
|
|
|
params = m_directiveHandler->waitForNext(SHORT_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Do not signal to the AIP to start recognizing.
|
|
|
|
|
|
|
|
// Check that AIP is now in EXPECTING_SPEECH state.
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(
|
2017-10-02 22:59:05 +00:00
|
|
|
AudioInputProcessorObserverInterface::State::EXPECTING_SPEECH, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has stayed foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that ExpectSpeechTimeOut event has been sent.
|
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_EXPECT_SPEECH_TIMED_OUT));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle no audio being written triggered by a hold to talk button.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, no audio is fed into a stream after button sends recognize to AudioInputProcessor. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* AudioInputProcessor is then observed to send a Recognize event to AVS which responds with no directive.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkNoAudio) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Write nothing to the SDS.
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been backgrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that AIP is in BUSY state.
|
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::BUSY, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
|
|
|
// The test channel client has been notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(LONG_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that a recognize event was sent
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that no prehandle or handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to handle a cancel partway through a hold to talk interaction.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Tell me a joke" is fed into a stream after button sends recognize to AudioInputProcessor. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* button then sends a cancel command and no recognize event is sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, holdToTalkCancel) {
|
|
|
|
// Signal to the AIP to start recognizing.
|
|
|
|
ASSERT_NE(nullptr, m_HoldToTalkAudioProvider);
|
|
|
|
ASSERT_TRUE(m_holdToTalkButton->startRecognizing(m_AudioInputProcessor, m_HoldToTalkAudioProvider));
|
|
|
|
|
|
|
|
// Check that AIP is now in RECOGNIZING state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::RECOGNIZING, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Cancel the recognize.
|
|
|
|
m_AudioInputProcessor->resetState();
|
|
|
|
|
|
|
|
// Put audio onto the SDS saying "Tell me a joke".
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
ASSERT_FALSE(audioData.empty());
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Stop holding the button.
|
|
|
|
ASSERT_FALSE(m_holdToTalkButton->stopRecognizing(m_AudioInputProcessor));
|
|
|
|
|
|
|
|
// Check that AIP is in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, LONG_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// Check that the test context provider was not asked to provide context for the event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that no recognize event was sent.
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(checkSentEventName(m_avsConnectionManager, NAME_RECOGNIZE));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that no prehandle or handle for setMute and Speak has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test AudioInputProcessor's ability to not handle audio when no recognize occurs.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* To do this, audio of "Tell me a joke" is fed into a stream that is being read by a wake word engine. The
|
2017-05-18 05:02:48 +00:00
|
|
|
* lack of the wakeword or button-initiated recognize results in no recognize event being sent.
|
|
|
|
*/
|
|
|
|
TEST_F(AudioInputProcessorTest, audioWithoutAnyTrigger) {
|
|
|
|
// Put audio onto the SDS saying "Tell me a joke" without a trigger.
|
|
|
|
bool error;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
std::string file = g_inputPath + JOKE_AUDIO_FILE;
|
2018-03-09 00:55:39 +00:00
|
|
|
std::vector<int16_t> audioData = readAudioFromFile<int16_t>(file, RIFF_HEADER_SIZE, &error);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_FALSE(error);
|
|
|
|
m_AudioBufferWriter->write(audioData.data(), audioData.size());
|
|
|
|
|
|
|
|
// Check that AIP is still in an IDLE state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(m_StateObserver->checkState(AudioInputProcessorObserverInterface::State::IDLE, SHORT_TIMEOUT_DURATION));
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that the test context provider was asked to provide context as the post-connect objects would have fetched
|
|
|
|
// context to send StateSynchronizer event.
|
|
|
|
ASSERT_TRUE(m_stateProvider->checkStateRequested());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
|
|
|
// The test channel client has been not notified the alarm channel has been foregrounded.
|
2017-09-19 22:08:49 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(SHORT_TIMEOUT_DURATION), FocusState::NONE);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that no prehandle or handle has reached the test SS.
|
2017-09-19 22:08:49 +00:00
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(NO_TIMEOUT_DURATION);
|
2017-05-18 05:02:48 +00:00
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace integration
|
|
|
|
} // namespace alexaClientSDK
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
int main(int argc, char** argv) {
|
2017-05-18 05:02:48 +00:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
if (argc < 3) {
|
2017-12-09 00:07:37 +00:00
|
|
|
std::cerr << "USAGE: " << std::string(argv[0]) << " <path_to_AlexaClientSDKConfig.json> <path_to_inputs_folder>"
|
2017-10-02 22:59:05 +00:00
|
|
|
<< std::endl;
|
2017-05-18 05:02:48 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
} else {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
alexaClientSDK::integration::test::g_configPath = std::string(argv[1]);
|
|
|
|
alexaClientSDK::integration::test::g_inputPath = std::string(argv[2]);
|
2017-05-18 05:02:48 +00:00
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|
|
|
|
}
|