An AudioIn is a deivce that can take audio input.
More...
#include "components/audio_in.hpp"
|
| struct | audio_chunk |
| | A sequential chunk of audio data with timing information for continuous audio streams. More...
|
| |
|
| void | get_audio (std::string const &codec, std::function< bool(audio_chunk &&chunk)> const &chunk_handler, double const &duration_seconds, int64_t const &previous_timestamp) |
| | Get a stream of audio from the device until completed or cancelled.
|
| |
| virtual void | get_audio (std::string const &codec, std::function< bool(audio_chunk &&chunk)> const &chunk_handler, double const &duration_seconds, int64_t const &previous_timestamp, const ProtoStruct &extra)=0 |
| | Get a stream of audio from the device until completed or cancelled.
|
| |
|
audio_properties | get_properties () |
| | Returns properties of the audio in device (supported codecs, sample rate, number of channels)
|
| |
| virtual audio_properties | get_properties (const ProtoStruct &extra)=0 |
| | Returns properties of the audio in device (supported codecs, sample rate, number of channels)
|
| |
| virtual ProtoStruct | do_command (const ProtoStruct &command)=0 |
| |
| std::vector< GeometryConfig > | get_geometries () |
| | Returns GeometryConfigs associated with the calling AudioIn.
|
| |
| virtual std::vector< GeometryConfig > | get_geometries (const ProtoStruct &extra)=0 |
| | Returns GeometryConfigs associated with the calling AudioIn.
|
| |
| API | api () const override |
| | Returns the API associated with a particular resource.
|
| |
| Name | get_resource_name () const override |
| | Returns the Name for a particular 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.
|
| |
|
|
| AudioIn (std::string name) |
| |
|
| Component (std::string name) |
| |
|
Name | get_resource_name (const std::string &type) const |
| |
An AudioIn is a deivce that can take audio input.
This acts as an abstract parent class to be inherited from by any drivers representing specific AudioIn implementations. This class cannot be used on its own.
◆ api()
| API viam::sdk::AudioIn::api |
( |
| ) |
const |
|
overridevirtual |
◆ do_command()
| virtual ProtoStruct viam::sdk::AudioIn::do_command |
( |
const ProtoStruct & | command | ) |
|
|
pure virtual |
◆ get_audio() [1/2]
| void viam::sdk::AudioIn::get_audio |
( |
std::string const & | codec, |
|
|
std::function< bool(audio_chunk &&chunk)> const & | chunk_handler, |
|
|
double const & | duration_seconds, |
|
|
int64_t const & | previous_timestamp ) |
|
inline |
Get a stream of audio from the device until completed or cancelled.
- Parameters
-
| codec | requested codec of the audio data |
| chunk_handler | callback function to call when an audio response is received. This should return true to keep streaming audio and false to indicate that the stream should terminate. The callback function should not be blocking. |
| duration_seconds | duration of audio stream. If not set, stream duration is indefinite. |
| previous_timestamp | timestamp to start the audio stream from for continuity between multiple calls. If not set, will stream data |
◆ get_audio() [2/2]
| virtual void viam::sdk::AudioIn::get_audio |
( |
std::string const & | codec, |
|
|
std::function< bool(audio_chunk &&chunk)> const & | chunk_handler, |
|
|
double const & | duration_seconds, |
|
|
int64_t const & | previous_timestamp, |
|
|
const ProtoStruct & | extra ) |
|
pure virtual |
Get a stream of audio from the device until completed or cancelled.
- Parameters
-
| codec | requested codec of the audio data |
| chunk_handler | callback function to call when an audio response is received. For an infinite stream this should return true to keep streaming audio and false to indicate that the stream should terminate. The callback function should not be blocking. |
| duration_seconds | duration of audio stream. If zero, stream duration is indefinite. |
| previous_timestamp | timestamp to start the audio stream from for continuity between multiple calls. If zero, will stream data |
| extra | Any additional arguments to the method |
Implemented in viam::sdk::impl::AudioInClient, and viam::sdk::impl::AudioInClient.
◆ get_geometries() [1/2]
◆ get_geometries() [2/2]
| virtual std::vector< GeometryConfig > viam::sdk::AudioIn::get_geometries |
( |
const ProtoStruct & | extra | ) |
|
|
pure virtual |
◆ get_properties()
| virtual audio_properties viam::sdk::AudioIn::get_properties |
( |
const ProtoStruct & | extra | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: