Skip to main content

CompressedAudio

A single chunk of a compressed audio bitstream

Schema

fieldtypedescription
timestampTimestampTimestamp of the start of the audio chunk
databytesCompressed audio data. Packet duration is determined by the codec during encoding. Messages should generally contain approximately 20 ms of audio.
formatstringAudio format. Values supported by Foxglove are opus for raw Opus packets and mp4a.40.2 for AAC-LC ADTS frames.

data

  • opus
    • Each message must contain a complete raw Opus packet, without Ogg, WebM, or other container framing, as described in RFC 6716 section 3.
    • Each packet contains all information necessary for decoding, and may be decoded at any sample rate supported by Opus (8, 12, 16, 24, or 48 kHz).
    • A single raw Opus packet represents mono or stereo audio; multichannel Opus requires multistream or container metadata and is not supported by this schema.
  • mp4a.40.2
    • Each message must contain a complete MPEG-4 AAC-LC ADTS frame, including the ADTS header, as described in section 1.A.3.2 of ISO/IEC 14496-3:2019.
    • The ADTS header supplies stream parameters such as sample rate and channel configuration.

Reference implementations

Foxglove messages are framework-agnostic, and can be implemented using any supported message encoding:

encodingschema
ROS 1foxglove_msgs/CompressedAudio
ROS 2foxglove_msgs/msg/CompressedAudio
JSONfoxglove.CompressedAudio
Protobuffoxglove.CompressedAudio
FlatBuffersfoxglove.CompressedAudio
OMG IDLfoxglove::CompressedAudio

You must use the schema names specified above for Foxglove to recognize the schema.