AudioProcessor allows processing audio data from the Android container and perform audio processing like audio playback and recording according to different platforms.
More...
#include <audio_processor.h>
AudioProcessor allows processing audio data from the Android container and perform audio processing like audio playback and recording according to different platforms.
Definition at line 34 of file audio_processor.h.
◆ AudioProcessor() [1/2]
anbox::AudioProcessor::AudioProcessor |
( |
| ) |
|
|
default |
◆ ~AudioProcessor()
virtual anbox::AudioProcessor::~AudioProcessor |
( |
| ) |
|
|
virtualdefault |
◆ AudioProcessor() [2/2]
◆ activate()
Notify the platform when an audio stream is in activation mode.
This function will be called when an audio stream is in activation mode. If a platform is notified by Anbox that one audio stream is going to activation mode,
- Parameters
-
type | the specified audio stream type. |
- Returns
- 0 on success or negative on failure.
Definition at line 111 of file audio_processor.h.
◆ need_silence_on_standby()
virtual bool anbox::AudioProcessor::need_silence_on_standby |
( |
| ) |
const |
|
inlinevirtual |
Produce a silent audio stream on need while the audio output stream goes into the standby state.
Anbox will produce a silent audio stream while the audio output stream goes into the standby state if this function returns true, otherwise returns false. Producing a silent audio stream helps with the audio latency reduction when doing audio playback if no audio output device is installed on a platform.
- Returns
- true when needs to produce a silent audio stream while audio output stream goes into the standby state, otherwise return false.
Definition at line 127 of file audio_processor.h.
◆ operator=()
◆ process_data()
virtual size_t anbox::AudioProcessor::process_data |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
pure virtual |
Process a chunk of audio data.
This function allows processing a single chunk of audio data. The audio data is passed by directly from the Android container to Anbox for audio playback
- Parameters
-
data | Pointer to the chunk of audio data that is passed from the anbox container. |
size | the number of bytes to be processed. |
- Returns
- The number of bytes actually processed on success.
◆ read_data()
virtual ssize_t anbox::AudioProcessor::read_data |
( |
uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Read a chunk of audio data.
This function allows reading a single chunk of audio data. The audio data is passed by directly from Anbox to the Android container for audio recording
- Parameters
-
data | Pointer to the chunk of audio data that is passed from the Anbox. |
size | the number of bytes to be read. |
- Returns
- The number of bytes actually read, otherwise returns a negative value on error
Definition at line 80 of file audio_processor.h.
◆ standby()
Notify the platform when an audio stream is in standby mode.
This function will be called when an audio stream enters standby mode. If a platform is notified by Anbox that one audio stream is going to standby mode, it's always good to drain the audio buffer cached on the platform side since this reduces the accumulated latency efficiently.
- Parameters
-
type | the specified audio stream type. |
- Returns
- 0 on success or negative on failure.
Definition at line 97 of file audio_processor.h.
◆ write_data()
virtual ssize_t anbox::AudioProcessor::write_data |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Write a chunk of audio data.
This function allows writing a single chunk of audio data. The audio data is passed by directly from the Android container to Anbox for audio playback
- Parameters
-
data | Pointer to the chunk of audio data that is passed from the anbox container. |
size | the number of bytes to be written. |
- Returns
- The number of bytes actually written on success, otherwise returns a negative value on error
Definition at line 64 of file audio_processor.h.
The documentation for this class was generated from the following file: