Viam C++ SDK current
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::AudioOut Class Referenceabstract

An AudioOut is a device that can output audio. More...

#include "components/audio_out.hpp"

+ Inheritance diagram for viam::sdk::AudioOut:

Public Types

using audio_info = viam::sdk::audio_info
 

Public Member Functions

void play (std::vector< uint8_t > const &audio_data, boost::optional< audio_info > info)
 Play audio data.
 
virtual void play (std::vector< uint8_t > const &audio_data, boost::optional< audio_info > info, const ProtoStruct &extra)=0
 Play audio through the audioout component.
 
audio_properties get_properties ()
 Returns properties of the audio out device (supported codecs, sample rate, number of channels)
 
virtual audio_properties get_properties (const ProtoStruct &extra)=0
 Returns properties of the audio out device (supported codecs, sample rate, number of channels)
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfigget_geometries ()
 
virtual std::vector< GeometryConfigget_geometries (const ProtoStruct &extra)=0
 Returns GeometryConfigs associated with the calling audioout.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 
void set_log_level (log_level) const
 Set the log level for log messages originating from this Resource.
 

Protected Member Functions

 AudioOut (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Additional Inherited Members

- Protected Attributes inherited from viam::sdk::Resource
LogSource logger_
 

Detailed Description

An AudioOut is a device that can output audio.

This acts as an abstract parent class to be inherited from by any drivers representing specific AudioOut implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::AudioOut::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::AudioOut::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

Parameters
commandthe command to execute.
Returns
The result of the executed command.

Implemented in viam::sdk::impl::AudioOutClient.

◆ get_geometries() [1/2]

std::vector< GeometryConfig > viam::sdk::AudioOut::get_geometries ( )
inline
Returns
The requested GeometryConfigs associated with the component.

◆ get_geometries() [2/2]

virtual std::vector< GeometryConfig > viam::sdk::AudioOut::get_geometries ( const ProtoStruct & extra)
pure virtual

Returns GeometryConfigs associated with the calling audioout.

Parameters
extraAny additional arguments to the method.
Returns
The requested GeometryConfigs associated with the component.

Implemented in viam::sdk::impl::AudioOutClient, and viam::sdk::impl::AudioOutClient.

◆ get_properties()

virtual audio_properties viam::sdk::AudioOut::get_properties ( const ProtoStruct & extra)
pure virtual

Returns properties of the audio out device (supported codecs, sample rate, number of channels)

Parameters
extraAny additional arguments to the method

Implemented in viam::sdk::impl::AudioOutClient, and viam::sdk::impl::AudioOutClient.

◆ play() [1/2]

void viam::sdk::AudioOut::play ( std::vector< uint8_t > const & audio_data,
boost::optional< audio_info > info )
inline

Play audio data.

Parameters
audio_dataThe audio data to play as bytes
infoOptional info about the audio_data (codec, sample rate, channels). Required for raw PCM data.

◆ play() [2/2]

virtual void viam::sdk::AudioOut::play ( std::vector< uint8_t > const & audio_data,
boost::optional< audio_info > info,
const ProtoStruct & extra )
pure virtual

Play audio through the audioout component.

Parameters
audio_dataThe audio data to play
infoOptional info about the audio_data (codec, sample rate, channels). Required for raw PCM data.
extraAny additional arguments to the method

Implemented in viam::sdk::impl::AudioOutClient, and viam::sdk::impl::AudioOutClient.


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