Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Version 1.15 alexa-client-sdk
Browse files Browse the repository at this point in the history
Changes in this update:

**Enhancements**

* Added `SystemSoundPlayer` to [ApplicationUtilities](https://alexa.github.io/avs-device-sdk/namespacealexa_client_s_d_k_1_1application_utilities.html). `SystemSoundPlayer` is a new class that plays pre-defined sounds. Sounds currently supported include the wake word notification and the end of speech tone. This change is internal and you don't need to update your code.
* Removed [Echo Spatial Perception (ESP)](https://developer.amazon.com/blogs/alexa/post/042be85c-5a62-4c55-a18d-d7a82cf394df/esp-moves-to-the-cloud-for-alexa-enabled-devices) functionality from the Alexa Voice Service (AVS) device SDK. Make sure you download and test your devices using the new AVS SDK sample app. If you're using an older version of the sample app, manually remove any references to ESP or errors occur during compile.
* Added `onNotificationReceived` to `NotificationsObserverInterface`. `onNotificationReceived` broadcasts when `NotificationsObserverInterface` receives a new notification, instead of only sending the indicator state. This is important if you support a feature that requires a distinct signal for each notification received. See [NotificationsObserverInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1sdk_interfaces_1_1_notifications_observer_interface.html) for more details.
* Added support for [Multilingual Mode](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations). With this enabled, Alexa automatically detects what language a user speaks by analyzing the spoken wake word and proceeding utterances. Once Alexa identifies the language, all corresponding responses are in the same language. The current supported language pairs are:
 - `[ "en-US", "es-US" ]`
 - `[ "es-US", "en-US" ]`
 - `[ "en-IN", "hi-IN" ]`
 - `[ "hi-IN", "en-IN" ]`
 - `[ "en-CA", "fr-CA" ]`
 - `[ "fr-CA", "en-CA" ]`
<br/> **IMPORTANT**: Specify the locales your device supports in the [localeCombinations](https://developer.amazon.com/docs/alexa-voice-service/system.html#localecombinations) field in AlexaClientSDKConfig.json. This field can't be empty. If you don't set these values, the sample app fails to run.
* Added two new system settings, [Timezone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) and [Locale](https://developer.amazon.com/docs/alexa-voice-service/system.html#locales).
    - Timezone: For example, you can set the `defaultTimezone` to `America/Vancouver`. If you don't set a value, `GMT` is set as the default value. If you set a new timezone, make sure that your AVS system settings and default timezone stay in sync. To handle this, use the new class `SystemTimeZoneInterface`. See [System Interface > SetTimeZone](https://developer.amazon.com/docs/alexa-voice-service/system.html#settimezone) for more information.
    - Locale: For example, you can set `defaultLocale` to `en-GB`, instead of the default `en-US`.
* The [SpeechRecognizer](https://developer.amazon.com/docs/alexa-voice-service/speechrecognizer.html) interface now supports the following functionalities.
  - Change wake word (`Alexa` supported for now).
  - Toggle start of request tone on/off.
  - Toggle End of request tone on/off.
* Deprecated the [CapabilityAgents](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1avs_1_1_capability_agent.html) `Settings{…}` library. `Settings {…}` now maps to an interface that's no longer supported. You might need to update your code to handle these changes. Read [Settings Interface](https://developer.amazon.com/docs/alexa-voice-service/per-interface-settings.html) for more details.
* Added support for three new locals: Spanish - United States (ES_US), Hindi - India (HI_IN), and Brazilian - Portuguese (PT_BR).
* Linked the atomic library to the sample app to prevent build errors on Raspberry Pi.

**Bug Fixes**

* Fixed resource leaking in [EqualizerCapabilityAgent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1equalizer_1_1_equalizer_capability_agent.html) after engine shutdown.
* [Issue 1391:](#1391) Fixed an issue where [SQLiteDeviceSettingsStorage::open](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1settings_1_1storage_1_1_s_q_lite_device_setting_storage.html#a7733e56145916f7ff265c5c950add492) tries to acquire a mutex twice, resulting in deadlock.
* [Issue 1468:](#1468) Fixed a bug in [AudioPlayer::cancelDirective](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html#a2c710c16f3627790fcc3238d34da9361) that causes a crash.
* Fixed Windows install script that caused the sample app build to fail - removed pip, flask, requests, and commentjson dependencies from the mingw.sh helper script.
* Fixed issue: notifications failed to sync upon device initialization. For example, let's say you had two devices - one turned on and the other turned off. After clearing the notification on the first device, it still showed up on the second device after turning it on.
* Fixed issue: barging in on a reminder caused it to stick in an inconsistent state, blocking subsequent reminders. For example, if a reminder was going off and you interrupted it, the reminder would get persist indefinitely. You could schedule future reminders, but they wouldn't play. Saying “Alexa stop” or rebooting the device fixed the “stuck” reminder.

**Known Issues**

* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a  workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
  • Loading branch information
kclchan committed Sep 25, 2019
1 parent 34b2a99 commit 2e9428e
Show file tree
Hide file tree
Showing 208 changed files with 33,725 additions and 3,689 deletions.
4 changes: 2 additions & 2 deletions ACL/include/ACL/Transport/ExchangeHandlerContextInterface.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +46,7 @@ class ExchangeHandlerContextInterface {
virtual void onDownchannelFinished() = 0;

/**
* Notification that an @c MessgeRequest has been sent.
* Notification that an @c MessageRequest has been sent.
*/
virtual void onMessageRequestSent() = 0;

Expand Down
17 changes: 9 additions & 8 deletions ACL/src/Transport/HTTP2Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ HTTP2Transport::HTTP2Transport(
}

void HTTP2Transport::addObserver(std::shared_ptr<TransportObserverInterface> transportObserver) {
ACSDK_DEBUG5(LX(__func__).d("transportObserver", transportObserver.get()));
ACSDK_DEBUG7(LX(__func__).d("transportObserver", transportObserver.get()));

if (!transportObserver) {
ACSDK_ERROR(LX("addObserverFailed").d("reason", "nullObserver"));
Expand All @@ -200,7 +200,7 @@ void HTTP2Transport::addObserver(std::shared_ptr<TransportObserverInterface> tra
}

void HTTP2Transport::removeObserver(std::shared_ptr<TransportObserverInterface> transportObserver) {
ACSDK_DEBUG5(LX(__func__).d("transportObserver", transportObserver.get()));
ACSDK_DEBUG7(LX(__func__).d("transportObserver", transportObserver.get()));

if (!transportObserver) {
ACSDK_ERROR(LX("removeObserverFailed").d("reason", "nullObserver"));
Expand Down Expand Up @@ -322,7 +322,7 @@ void HTTP2Transport::onAuthStateChange(
}

void HTTP2Transport::doShutdown() {
ACSDK_DEBUG5(LX(__func__));
ACSDK_DEBUG7(LX(__func__));
setState(State::SHUTDOWN, ConnectionStatusObserverInterface::ChangedReason::ACL_CLIENT_REQUEST);
disconnect();
m_authDelegate->removeAuthObserver(shared_from_this());
Expand All @@ -336,12 +336,12 @@ void HTTP2Transport::doShutdown() {
}

void HTTP2Transport::onDownchannelConnected() {
ACSDK_DEBUG5(LX(__func__));
ACSDK_DEBUG7(LX(__func__));
setState(State::POST_CONNECTING, ConnectionStatusObserverInterface::ChangedReason::SUCCESS);
}

void HTTP2Transport::onDownchannelFinished() {
ACSDK_DEBUG5(LX(__func__));
ACSDK_DEBUG7(LX(__func__));

std::lock_guard<std::mutex> lock(m_mutex);

Expand Down Expand Up @@ -437,7 +437,7 @@ std::string HTTP2Transport::getEndpoint() {
}

void HTTP2Transport::mainLoop() {
ACSDK_DEBUG5(LX(__func__));
ACSDK_DEBUG7(LX(__func__));

m_postConnect = m_postConnectFactory->createPostConnect();
if (!m_postConnect || !m_postConnect->doPostConnect(shared_from_this())) {
Expand Down Expand Up @@ -471,6 +471,7 @@ void HTTP2Transport::mainLoop() {
break;
case State::SERVER_SIDE_DISCONNECT:
nextState = handleServerSideDisconnect();
break;
case State::DISCONNECTING:
nextState = handleDisconnecting();
break;
Expand All @@ -481,7 +482,7 @@ void HTTP2Transport::mainLoop() {

handleShutdown();

ACSDK_DEBUG5(LX("mainLoopExiting"));
ACSDK_DEBUG7(LX("mainLoopExiting"));
}

HTTP2Transport::State HTTP2Transport::handleInit() {
Expand Down Expand Up @@ -540,7 +541,7 @@ HTTP2Transport::State HTTP2Transport::handleWaitingToRetryConnecting() {
ACSDK_DEBUG7(LX(__func__));

std::chrono::milliseconds timeout = TransportDefines::RETRY_TIMER.calculateTimeToRetry(m_connectRetryCount);
ACSDK_DEBUG5(
ACSDK_DEBUG7(
LX("handleConnectingWaitingToRetry").d("connectRetryCount", m_connectRetryCount).d("timeout", timeout.count()));
m_connectRetryCount++;
std::unique_lock<std::mutex> lock(m_mutex);
Expand Down
2 changes: 1 addition & 1 deletion ACL/src/Transport/MessageRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ std::shared_ptr<MessageRequestHandler> MessageRequestHandler::create(
std::shared_ptr<avsCommon::avs::MessageRequest> messageRequest,
std::shared_ptr<MessageConsumerInterface> messageConsumer,
std::shared_ptr<avsCommon::avs::attachment::AttachmentManager> attachmentManager) {
ACSDK_DEBUG5(LX(__func__).d("context", context.get()).d("messageRequest", messageRequest.get()));
ACSDK_DEBUG7(LX(__func__).d("context", context.get()).d("messageRequest", messageRequest.get()));

if (!context) {
ACSDK_CRITICAL(LX("MessageRequestHandlerCreateFailed").d("reason", "nullHttp2Transport"));
Expand Down
1 change: 1 addition & 0 deletions ACL/src/Transport/MessageRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void MessageRouter::onDisconnected(

void MessageRouter::onServerSideDisconnect(std::shared_ptr<TransportInterface> transport) {
std::unique_lock<std::mutex> lock{m_connectionMutex};
ACSDK_DEBUG5(LX("server-side disconnect received").d("Message router is enabled", m_isEnabled));
if (m_isEnabled) {
setConnectionStatusLocked(
ConnectionStatusObserverInterface::Status::PENDING,
Expand Down
6 changes: 3 additions & 3 deletions ACL/test/Transport/MockAuthDelegate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,10 +50,10 @@ class MockAuthDelegate : public avsCommon::sdkInterfaces::AuthDelegateInterface
std::string m_authToken;
};

std::string MockAuthDelegate::getAuthToken() {
inline std::string MockAuthDelegate::getAuthToken() {
return m_authToken;
}
void MockAuthDelegate::setAuthToken(std::string authToken) {
inline void MockAuthDelegate::setAuthToken(std::string authToken) {
m_authToken = authToken;
}

Expand Down
17 changes: 14 additions & 3 deletions ADSL/src/DirectiveProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ bool DirectiveProcessor::onDirective(std::shared_ptr<AVSDirective> directive) {

if (bypassDialogRequestIDCheck) {
ACSDK_INFO(LX("onDirective")
.d("messageId", directive->getMessageId())
.d("action", "bypassingDialogRequestIdCheck")
.d("reason", "routinesDirectiveContainsDialogRequestId")
.d("directiveNamespace", "InteractionModel")
.d("directiveName", "NewDialogRequest"));
.d("namespace", directive->getNamespace())
.d("name", directive->getName())
.d("directivesDialogRequestId", directive->getDialogRequestId())
.d("dialogRequestId", m_dialogRequestId));
} else if (!directive->getDialogRequestId().empty() && directive->getDialogRequestId() != m_dialogRequestId) {
ACSDK_INFO(LX("onDirective")
.d("messageId", directive->getMessageId())
.d("action", "dropped")
.d("reason", "dialogRequestIdDoesNotMatch")
.d("namespace", directive->getNamespace())
.d("name", directive->getName())
.d("directivesDialogRequestId", directive->getDialogRequestId())
.d("dialogRequestId", m_dialogRequestId));
return true;
Expand Down Expand Up @@ -408,7 +413,13 @@ bool DirectiveProcessor::handleQueuedDirectivesLocked(std::unique_lock<std::mute
}

if (!handleDirectiveSucceeded) {
ACSDK_ERROR(LX("handleDirectiveFailed").d("message id", directive->getMessageId()));
ACSDK_ERROR(LX("handleDirectiveFailed")
.d("message id", directive->getMessageId())
.d("namespace", directive->getNamespace())
.d("name", directive->getName())
.d("reason", "dialog request id does not match")
.d("directive's dialog request id", directive->getDialogRequestId())
.d("dialog request id", m_dialogRequestId));
scrubDialogRequestIdLocked(directive->getDialogRequestId());
}
}
Expand Down
2 changes: 1 addition & 1 deletion ADSL/test/DirectiveSequencerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ TEST_F(DirectiveSequencerTest, test_handleBlockingThenImmediatelyThenNonBockingO
EXPECT_CALL(*(handler1.get()), preHandleDirective(directive1, _)).Times(1).InSequence(s1, s2);
EXPECT_CALL(*(handler2.get()), preHandleDirective(directive2, _)).Times(1).InSequence(s2);

EXPECT_CALL(*(handler1.get()), handleDirective(_)).Times(1).InSequence(s2);
EXPECT_CALL(*(handler1.get()), handleDirective(_)).Times(1).InSequence(s1);
EXPECT_CALL(*(handler1.get()), cancelDirective(_)).Times(0);

EXPECT_CALL(*(handler2.get()), handleDirectiveImmediately(_)).Times(0);
Expand Down
4 changes: 2 additions & 2 deletions AVSCommon/AVS/include/AVSCommon/AVS/CapabilityAgent.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -220,7 +220,7 @@ class CapabilityAgent
const std::string& eventName,
const std::string& dialogRequestIdString = "",
const std::string& payload = "{}",
const std::string& context = "");
const std::string& context = "") const;

/// The namespace of the capability agent.
const std::string m_namespace;
Expand Down
17 changes: 16 additions & 1 deletion AVSCommon/AVS/include/AVSCommon/AVS/EventBuilder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,21 @@
namespace alexaClientSDK {
namespace avsCommon {
namespace avs {
namespace constants {

/// The namespace key in the header of the event.
static const std::string NAMESPACE_KEY_STRING = "namespace";

/// The name key in the header of the event.
static const std::string NAME_KEY_STRING = "name";

/// The header key in the event.
static const std::string HEADER_KEY_STRING = "header";

/// The payload key in the event.
static const std::string PAYLOAD_KEY_STRING = "payload";

} // namespace constants

/**
* Builds a JSON event string which includes the header, the @c payload and an optional @c context.
Expand Down
5 changes: 3 additions & 2 deletions AVSCommon/AVS/src/Attachment/AttachmentManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -99,7 +99,8 @@ AttachmentManager::AttachmentManagementDetails& AttachmentManager::getDetailsLoc
switch (m_attachmentType) {
// The in-process attachment type.
case AttachmentType::IN_PROCESS:
details.attachment = make_unique<InProcessAttachment>(attachmentId);
details.attachment =
alexaClientSDK::avsCommon::utils::memory::make_unique<InProcessAttachment>(attachmentId);
break;
}

Expand Down
4 changes: 2 additions & 2 deletions AVSCommon/AVS/src/CapabilityAgent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -161,7 +161,7 @@ const std::pair<std::string, std::string> CapabilityAgent::buildJsonEventString(
const std::string& eventName,
const std::string& dialogRequestIdString,
const std::string& payload,
const std::string& context) {
const std::string& context) const {
return avs::buildJsonEventString(m_namespace, eventName, dialogRequestIdString, payload, context);
}

Expand Down
15 changes: 2 additions & 13 deletions AVSCommon/AVS/src/EventBuilder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,7 @@ namespace avs {

using namespace rapidjson;
using namespace utils;
using namespace avs::constants;

/// String to identify log entries originating from this file.
static const std::string TAG("EventBuilder");
Expand All @@ -41,24 +42,12 @@ static const std::string TAG("EventBuilder");
*/
#define LX(event) alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

/// The namespace key in the header of the event.
static const std::string NAMESPACE_KEY_STRING = "namespace";

/// The name key in the header of the event.
static const std::string NAME_KEY_STRING = "name";

/// The message id key in the header of the event
static const std::string MESSAGE_ID_KEY_STRING = "messageId";

/// The dialog request Id key in the header of the event.
static const std::string DIALOG_REQUEST_ID_KEY_STRING = "dialogRequestId";

/// The header key in the event.
static const std::string HEADER_KEY_STRING = "header";

/// The payload key in the event.
static const std::string PAYLOAD_KEY_STRING = "payload";

/// The context key in the event.
static const std::string CONTEXT_KEY_STRING = "context";

Expand Down
3 changes: 2 additions & 1 deletion AVSCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ add_library(AVSCommon SHARED
Utils/src/TimePoint.cpp
Utils/src/TimeUtils.cpp
Utils/src/Timer.cpp
Utils/src/UUIDGeneration.cpp)
Utils/src/UUIDGeneration.cpp
Utils/src/WaitEvent.cpp)

target_include_directories(AVSCommon PUBLIC
"${AVSCommon_SOURCE_DIR}/AVS/include"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@
#include "AVSCommon/SDKInterfaces/Audio/AlertsAudioFactoryInterface.h"
#include "AVSCommon/SDKInterfaces/Audio/CommunicationsAudioFactoryInterface.h"
#include "AVSCommon/SDKInterfaces/Audio/NotificationsAudioFactoryInterface.h"
#include "AVSCommon/SDKInterfaces/Audio/SystemSoundAudioFactoryInterface.h"

namespace alexaClientSDK {
namespace avsCommon {
Expand Down Expand Up @@ -48,6 +49,11 @@ class AudioFactoryInterface {
* This shares a factory that produces audio streams for the communications components.
*/
virtual std::shared_ptr<CommunicationsAudioFactoryInterface> communications() const = 0;

/**
* This shares a factory that produces audio streams for the system sound components.
*/
virtual std::shared_ptr<SystemSoundAudioFactoryInterface> systemSounds() const = 0;
};

} // namespace audio
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*/

#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_AUDIO_SYSTEMSOUNDAUDIOFACTORYINTERFACE_H_
#define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_AUDIO_SYSTEMSOUNDAUDIOFACTORYINTERFACE_H_

#include <functional>
#include <istream>
#include <memory>

namespace alexaClientSDK {
namespace avsCommon {
namespace sdkInterfaces {
namespace audio {

/**
* This is an interface to produce streams of the system sound audio resources.
*/
class SystemSoundAudioFactoryInterface {
public:
/**
* Destructor
*/
virtual ~SystemSoundAudioFactoryInterface() = default;

/**
* Returns an audio stream to play for the end speech tone.
*
* @return audio stream of the end speech tone.
*/
virtual std::function<std::unique_ptr<std::istream>()> endSpeechTone() const = 0;

/**
* Returns an audio stream to play for the wake word notification tone.
*
* @return audio stream of the wake word notification tone.
*/
virtual std::function<std::unique_ptr<std::istream>()> wakeWordNotificationTone() const = 0;
};

} // namespace audio
} // namespace sdkInterfaces
} // namespace avsCommon
} // namespace alexaClientSDK

#endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_AUDIO_SYSTEMSOUNDAUDIOFACTORYINTERFACE_H_
Loading

0 comments on commit 2e9428e

Please sign in to comment.