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

This represents a microphone which injects audio data into the shared data stream. More...

#include <AudioInjectorMicrophone.h>

Inheritance diagram for alexaClientSDK::diagnostics::AudioInjectorMicrophone:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::diagnostics::AudioInjectorMicrophone:
Collaboration graph
[legend]

Public Member Functions

void injectAudio (const std::vector< uint16_t > &audioData)
 
 ~AudioInjectorMicrophone ()
 
MicrophoneInterface methods
bool stopStreamingMicrophoneData () override
 
bool startStreamingMicrophoneData () override
 
bool isStreaming () override
 
- Public Member Functions inherited from alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface
virtual ~MicrophoneInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< AudioInjectorMicrophonecreate (const std::shared_ptr< avsCommon::avs::AudioInputStream > &stream, const alexaClientSDK::avsCommon::utils::AudioFormat &compatibleAudioFormat)
 

Detailed Description

This represents a microphone which injects audio data into the shared data stream.

Constructor & Destructor Documentation

◆ ~AudioInjectorMicrophone()

alexaClientSDK::diagnostics::AudioInjectorMicrophone::~AudioInjectorMicrophone ( )

Destructor.

Member Function Documentation

◆ create()

static std::unique_ptr<AudioInjectorMicrophone> alexaClientSDK::diagnostics::AudioInjectorMicrophone::create ( const std::shared_ptr< avsCommon::avs::AudioInputStream > &  stream,
const alexaClientSDK::avsCommon::utils::AudioFormat compatibleAudioFormat 
)
static

Creates a AudioInjectorMicrophone.

Parameters
streamThe shared data stream to write to.
compatibleAudioFormatThe audio format.
Returns
A unique_ptr to a AudioInjectorMicrophone if creation was successful and nullptr otherwise.

◆ injectAudio()

void alexaClientSDK::diagnostics::AudioInjectorMicrophone::injectAudio ( const std::vector< uint16_t > &  audioData)

Injects audio into the audio buffer at the next possible moment. If the microphone is muted, audio will be injected when the microphone is unmuted.

Parameters
audioDataThe reference to the audioBuffer vector.

◆ isStreaming()

bool alexaClientSDK::diagnostics::AudioInjectorMicrophone::isStreaming ( )
overridevirtual

Whether the microphone is currently streaming.

Returns
Whether the microphone is streaming.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.

◆ startStreamingMicrophoneData()

bool alexaClientSDK::diagnostics::AudioInjectorMicrophone::startStreamingMicrophoneData ( )
overridevirtual

Starts streaming from the microphone.

Returns
Whether the start was successful.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.

◆ stopStreamingMicrophoneData()

bool alexaClientSDK::diagnostics::AudioInjectorMicrophone::stopStreamingMicrophoneData ( )
overridevirtual

Stops streaming from the microphone.

Returns
Whether the stop was successful.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.


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