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

#include <FormattedAudioStreamAdapter.h>

Public Member Functions

 FormattedAudioStreamAdapter (const AudioFormat &audioFormat)
 
AudioFormat getAudioFormat () const
 
void setListener (std::shared_ptr< FormattedAudioStreamAdapterListener > listener)
 
size_t send (const unsigned char *buffer, size_t size)
 

Detailed Description

A class providing the way to receive a sequence of audio data blocks and a format associated with it.

This class should be used when you want to publish a real time audio stream of the specified format to zero or one recipient without buffering the data. The receiving party may start listening at any moment. With no listener set all the published data is lost.

Constructor & Destructor Documentation

◆ FormattedAudioStreamAdapter()

alexaClientSDK::avsCommon::utils::bluetooth::FormattedAudioStreamAdapter::FormattedAudioStreamAdapter ( const AudioFormat audioFormat)
explicit

Constructor initializing the class with an AudioFormat.

Parameters
audioFormatAudioFormat describing the data being sent.

Member Function Documentation

◆ getAudioFormat()

AudioFormat alexaClientSDK::avsCommon::utils::bluetooth::FormattedAudioStreamAdapter::getAudioFormat ( ) const

Get AudioFormat associated with the class.

Returns
AudioFormat associated with the class.

◆ send()

size_t alexaClientSDK::avsCommon::utils::bluetooth::FormattedAudioStreamAdapter::send ( const unsigned char *  buffer,
size_t  size 
)

Publish data to the listener.

Parameters
bufferBuffer containing the data
sizeSize of the data block in bytes. The value must be greater than zero.
Returns
number of bytes processed.

◆ setListener()

void alexaClientSDK::avsCommon::utils::bluetooth::FormattedAudioStreamAdapter::setListener ( std::shared_ptr< FormattedAudioStreamAdapterListener listener)

Set the listener to receive data.

Parameters
listenerthe listener to receive data.

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