AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer Class Reference

#include <SystemSoundPlayer.h>

Inheritance diagram for alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer:
Collaboration graph
[legend]

Public Member Functions

SystemSoundPlayerInterface Functions
std::shared_future< bool > playTone (Tone tone) override
 
MediaPlayerObserverInterface Functions
void onPlaybackFinished (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackError (SourceId id, const avsCommon::utils::mediaPlayer::ErrorType &type, std::string error, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onPlaybackStarted (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
void onFirstByteRead (SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SystemSoundPlayerInterface
virtual ~SystemSoundPlayerInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface
virtual ~MediaPlayerObserverInterface ()=default
 
virtual void onFirstByteRead (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackStarted (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackFinished (SourceId id, const MediaPlayerState &state)=0
 
virtual void onPlaybackError (SourceId id, const ErrorType &type, std::string error, const MediaPlayerState &state)=0
 
virtual void onPlaybackPaused (SourceId, const MediaPlayerState &)
 
virtual void onPlaybackResumed (SourceId, const MediaPlayerState &)
 
virtual void onPlaybackStopped (SourceId, const MediaPlayerState &)
 
virtual void onBufferUnderrun (SourceId, const MediaPlayerState &)
 
virtual void onBufferRefilled (SourceId, const MediaPlayerState &)
 
virtual void onBufferingComplete (SourceId, const MediaPlayerState &)
 
virtual void onSeeked (SourceId, const MediaPlayerState &, const MediaPlayerState &)
 
virtual void onTags (SourceId, std::unique_ptr< const VectorOfTags >, const MediaPlayerState &)
 

Static Public Member Functions

static std::shared_ptr< SystemSoundPlayerInterface > createSystemSoundPlayerInterface (std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > audioPipelineFactory, std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface > audioFactory)
 
static std::shared_ptr< SystemSoundPlayercreate (std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > mediaPlayer, std::shared_ptr< avsCommon::sdkInterfaces::audio::SystemSoundAudioFactoryInterface > soundPlayerAudioFactory)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::SystemSoundPlayerInterface
enum  Tone { Tone::WAKEWORD_NOTIFICATION, Tone::END_SPEECH }
 The different system sounds supported. More...
 
- Public Types inherited from alexaClientSDK::avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface
enum  TagType {
  TagType::STRING, TagType::UINT, TagType::INT, TagType::DOUBLE,
  TagType::BOOLEAN
}
 The different types of metadata "stream tags". More...
 
using SourceId = MediaPlayerInterface::SourceId
 A type that identifies which source is currently being operated on. More...
 
typedef std::vector< TagKeyValueTypeVectorOfTags
 

Detailed Description

This class implements the SystemSoundPlayerInterface. This class is responsible for playing the system sounds that Alexa devices make.

Member Function Documentation

◆ create()

static std::shared_ptr<SystemSoundPlayer> alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::create ( std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface mediaPlayer,
std::shared_ptr< avsCommon::sdkInterfaces::audio::SystemSoundAudioFactoryInterface soundPlayerAudioFactory 
)
static

Creates a new SystemSoundPlayer instance.

Deprecated:
Use createSystemSoundPlayerInterface.
Parameters
mediaPlayerThe mediaPlayer that will play the system sound audio streams.
soundPlayerAudioFactoryThe audio factory that produces the system sound streams
Returns
A std::shared_ptr to the new SystemSoundPlayer instance or nullptr if invalid arguments.

◆ createSystemSoundPlayerInterface()

static std::shared_ptr<SystemSoundPlayerInterface> alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::createSystemSoundPlayerInterface ( std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface audioPipelineFactory,
std::shared_ptr< avsCommon::sdkInterfaces::audio::AudioFactoryInterface audioFactory 
)
static

Creates a new SystemSoundPlayerInterface instance.

Parameters
audioPipelineFactoryThe audio pipeline factory to create the media player and related interfaces.
audioFactoryThe audio factory that produces the system sound streams.
Returns
A std::shared_ptr to the new SystemSoundPlayer instance or nullptr if invalid arguments.

◆ onFirstByteRead()

void alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::onFirstByteRead ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackError()

void alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::onPlaybackError ( SourceId  id,
const avsCommon::utils::mediaPlayer::ErrorType type,
std::string  error,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackFinished()

void alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::onPlaybackFinished ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ onPlaybackStarted()

void alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::onPlaybackStarted ( SourceId  id,
const avsCommon::utils::mediaPlayer::MediaPlayerState state 
)
override

◆ playTone()

std::shared_future<bool> alexaClientSDK::applicationUtilities::systemSoundPlayer::SystemSoundPlayer::playTone ( Tone  tone)
overridevirtual

Method to play a system sound.

Parameters
toneThe tone to play.
Returns
A future that will return true on successful playback and false on error.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SystemSoundPlayerInterface.


The documentation for this class was generated from the following file:

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