Payloads#
A payload is a data container used to store and transfer different types of multimedia and data within messages.
BasePayload#
property |
type |
description |
---|---|---|
|
|
creates a deep copy of the payload instance |
AudioPayload#
property |
type |
description |
---|---|---|
|
|
NumPy array containing the audio data |
|
|
audio sampling rate in Hz |
|
|
number of audio channels |
|
|
start time in seconds |
|
|
end time in seconds |
An empty AudioPayload is created with:
audio
set tonp.ndarray(0)
sampling_rate
set to-1
channels
set to-1
start
set to-1.0
end
set to-1.0
ImagePayload#
property |
type |
description |
---|---|---|
|
|
NumPy array containing the image data |
|
|
image width in pixels |
|
|
image height in pixels |
|
|
image depth/channels (e.g., 3 for RGB, 4 for RGBA) |
|
|
pixel format description (e.g., ‘RGB’, ‘RGBA’, ‘BGR’) |
|
|
timestamp associated with the image |
An empty ImagePayload is created with:
image
set tonp.ndarray([0, 0])
width
set to-1
height
set to-1
depth
set to-1
pixel_format
set to''
timestamp
set to-1.0
VideoPayload#
property |
type |
description |
---|---|---|
|
|
list of ImagePayload objects representing video frames |
|
|
video frame rate in frames per second |
|
|
start time in seconds |
|
|
end time in seconds |
An empty VideoPayload is created with:
video
set tolist()
frames_per_second
set to-1.0
start
set to-1.0
end
set to-1.0
BytesPayload#
property |
type |
description |
---|---|---|
|
|
An empty BytesPayload is created with:
cnt
set tobytes()
ObjectPayload#
property |
type |
description |
---|---|---|
(inherits from dict) |
|
dictionary-like access for arbitrary object data |
An empty ObjectPayload is created as an empty dictionary.
Notes:
all payload classes inherit from
BasePayload
and provide aclone()
method for deep copyingdefault values of
-1
for numeric fields and empty strings/collections typically indicate unspecified or uninitialized valuesObjectPayload
combines dictionary functionality with payload cloning capabilities