![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <RendererInterface.h>
Public Member Functions | |
virtual | ~RendererInterface ()=default |
virtual void | start (std::shared_ptr< acsdkAlerts::renderer::RendererObserverInterface > observer, std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()> audioFactory, bool volumeRampEnabled, const std::vector< std::string > &urls=std::vector< std::string >(), int loopCount=0, std::chrono::milliseconds loopPause=std::chrono::milliseconds{0}, bool startWithPause=false)=0 |
virtual void | stop ()=0 |
An interface class which specifies an Alert
renderer.
|
virtualdefault |
Destructor.
|
pure virtual |
Start rendering. This api takes two sets of parameters - a local audio file, and a vector of urls. If the urls container is empty, then the local audio file will be played for either a maximum time of one hour, or until explicitly being stopped.
If the urls are non-empty, then they will be rendered in sequence, for loopCount number of times, with a pause of loopPauseInMilliseconds in between each sequence.
If any url fails to render (for example, if the url is invalid, or the media player cannot acquire it), then the renderer will default to the local audio file, with the behavior described above.
TODO : ACSDK-389 Investigate changing explicit file paths to a std::istream-based interface.
observer | The observer that will receive renderer events. |
audioFactory | A function that produces a pair of unique stream of audio and audio format that is used for the default if nothing else is available. |
volumeRampEnabled | whether this media should ramp |
urls | A container of urls to be rendered per the above description. |
loopCount | The number of times the urls should be rendered. |
loopPause | The duration which must expire between the beginning of rendering of any loop of audio. Therefore if the audio (either urls or local audio file) finishes before this duration, then the renderer will wait for the remainder of this time before starting the next loop. |
startWithPause | Indicates if the renderer should begin with an initial pause before rendering audio. This initial pause will be for the same duration as loopPause , and will not be considered part of the loopCount . |
|
pure virtual |
Stop rendering.
Implemented in alexaClientSDK::acsdkAlerts::renderer::Renderer.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0