This class represents audio frame - object for working with AudioEvent and Tensor objects which belong to this audio frame . AudioEvent describes detected object (segments) and its Tensor objects (inference results on AudioEvent level). Tensor describes inference results on AudioFrame level. AudioFrame also provides access to underlying GstBuffer and GstAudioInfo describing frame's audio information (such as format, channels, etc.).
More...
#include <audio_frame.h>
|
GstBuffer * | buffer |
| GstBuffer with inference results metadata attached (Gstreamer pipeline's GstBuffer, which is output of GVA inference elements, such as gvaaudiodetect)
|
|
std::unique_ptr< GstAudioInfo, std::function< void(GstAudioInfo *)> > | info |
| GstAudioInfo containing actual audio information for this AudioFrame.
|
|
This class represents audio frame - object for working with AudioEvent and Tensor objects which belong to this audio frame . AudioEvent describes detected object (segments) and its Tensor objects (inference results on AudioEvent level). Tensor describes inference results on AudioFrame level. AudioFrame also provides access to underlying GstBuffer and GstAudioInfo describing frame's audio information (such as format, channels, etc.).
◆ AudioFrame() [1/3]
GVA::AudioFrame::AudioFrame |
( |
GstBuffer * |
buffer, |
|
|
GstAudioInfo * |
info |
|
) |
| |
|
inline |
Construct AudioFrame instance from GstBuffer and GstAudioInfo. This is preferred way of creating AudioFrame.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
info | GstAudioInfo* containing audio information |
◆ AudioFrame() [2/3]
GVA::AudioFrame::AudioFrame |
( |
GstBuffer * |
buffer, |
|
|
const GstCaps * |
caps |
|
) |
| |
|
inline |
Construct AudioFrame instance from GstBuffer and GstCaps.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
caps | GstCaps* from which audio information is obtained |
◆ AudioFrame() [3/3]
GVA::AudioFrame::AudioFrame |
( |
GstBuffer * |
buffer | ) |
|
|
inline |
Construct AudioFrame instance from GstBuffer. Audio information will be obtained from buffer. This is not recommended way of creating AudioFrame, because it relies on GstAudioMeta which can be absent for the buffer.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
◆ add_event()
AudioEvent GVA::AudioFrame::add_event |
( |
long |
start_time, |
|
|
long |
end_time, |
|
|
std::string |
label = std::string() , |
|
|
double |
confidence = 0.0 |
|
) |
| |
|
inline |
Attach AudioEvent to this AudioFrame. This function takes ownership of event_tensor, if passed @start_time: start time stamp of the segment @end_time: end time stamp of the segment.
- Parameters
-
label | object label |
confidence | detection confidence |
- Returns
- new AudioEvent instance
◆ add_message()
void GVA::AudioFrame::add_message |
( |
const std::string & |
message | ) |
|
|
inline |
◆ add_tensor()
Tensor GVA::AudioFrame::add_tensor |
( |
| ) |
|
|
inline |
◆ audio_info()
GstAudioInfo* GVA::AudioFrame::audio_info |
( |
| ) |
|
|
inline |
Get GstAudioInfo of this AudioFrame. This is preferrable way of getting audio information.
- Returns
- GstAudioInfo of this AudioFrame
◆ audio_meta()
GstAudioMeta* GVA::AudioFrame::audio_meta |
( |
| ) |
|
|
inline |
Get audio metadata of buffer.
- Returns
- GstAudioMeta of buffer, nullptr if no GstAudioMeta available
◆ events() [1/2]
std::vector<AudioEvent> GVA::AudioFrame::events |
( |
| ) |
|
|
inline |
◆ events() [2/2]
const std::vector<AudioEvent> GVA::AudioFrame::events |
( |
| ) |
const |
|
inline |
◆ messages()
std::vector<std::string> GVA::AudioFrame::messages |
( |
| ) |
|
|
inline |
◆ remove_event()
void GVA::AudioFrame::remove_event |
( |
const AudioEvent & |
event | ) |
|
|
inline |
◆ remove_tensor()
void GVA::AudioFrame::remove_tensor |
( |
const Tensor & |
tensor | ) |
|
|
inline |
◆ tensors() [1/2]
std::vector<Tensor> GVA::AudioFrame::tensors |
( |
| ) |
|
|
inline |
◆ tensors() [2/2]
const std::vector<Tensor> GVA::AudioFrame::tensors |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: