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:
audioset tonp.ndarray(0)sampling_rateset to-1channelsset to-1startset to-1.0endset 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:
imageset tonp.ndarray([0, 0])widthset to-1heightset to-1depthset to-1pixel_formatset to''timestampset 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:
videoset tolist()frames_per_secondset to-1.0startset to-1.0endset to-1.0
BytesPayload#
property |
type |
description |
|---|---|---|
|
|
|
An empty BytesPayload is created with:
cntset 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
BasePayloadand provide aclone()method for deep copyingdefault values of
-1for numeric fields and empty strings/collections typically indicate unspecified or uninitialized valuesObjectPayloadcombines dictionary functionality with payload cloning capabilities