diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 183d253..6c776e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: [main] tags: ["releases/**"] pull_request: - branches: ["*"] + branches: ["**"] jobs: build: diff --git a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap index 7ee534d..41aa397 100644 --- a/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap +++ b/internal/__snapshots__/exportTypeScriptSchemas.test.ts.snap @@ -236,6 +236,40 @@ export type CompressedVideo = { */ format: string; }; +", + "CompressedAudio" => "// Generated by https://github.com/foxglove/schemas +// Options: {} + +import { Time } from "./Time"; + +/** A single frame of a compressed audio bitstream */ +export type CompressedAudio = { + /** Timestamp of audio frame */ + timestamp: Time; + + /** Compressed audio frame data. */ + data: Uint8Array; + + /** + * Audio format. + * + * Supported values: \`opus\`. + */ + format: string; + + /** + * Frame type. + * + * Supported values: \`key\`, \`delta\`. + */ + type: string; + + /** Number of audio samples per second. */ + sample_rate: number; + + /** Number of audio channels in the input. */ + number_of_channels: number; +}; ", "CylinderPrimitive" => "// Generated by https://github.com/foxglove/schemas // Options: {} @@ -1104,6 +1138,7 @@ export enum PositionCovarianceType { export * from "./CameraCalibration"; export * from "./CircleAnnotation"; export * from "./Color"; +export * from "./CompressedAudio"; export * from "./CompressedImage"; export * from "./CompressedVideo"; export * from "./CubePrimitive"; diff --git a/internal/schemas.ts b/internal/schemas.ts index 1bf5e5c..42f9ae8 100644 --- a/internal/schemas.ts +++ b/internal/schemas.ts @@ -843,6 +843,44 @@ Specifically, the requirements for different \`format\` values are: ], }; +const CompressedAudio: FoxgloveMessageSchema = { + type: "message", + name: "CompressedAudio", + description: "A single frame of a compressed audio bitstream", + fields: [ + { + name: "timestamp", + type: { type: "primitive", name: "time" }, + description: "Timestamp of audio frame", + }, + { + name: "data", + type: { type: "primitive", name: "bytes" }, + description: `Compressed audio frame data.`, + }, + { + name: "format", + type: { type: "primitive", name: "string" }, + description: "Audio format.\n\nSupported values: `opus`.", + }, + { + name: "type", + type: { type: "primitive", name: "string" }, + description: "Frame type.\n\n Supported values: `key`, `delta`.", + }, + { + name: "sample_rate", + type: { type: "primitive", name: "uint32" }, + description: "Number of audio samples per second.", + }, + { + name: "number_of_channels", + type: { type: "primitive", name: "uint32" }, + description: "Number of audio channels in the input.", + }, + ], +}; + const RawImage: FoxgloveMessageSchema = { type: "message", name: "RawImage", @@ -1482,6 +1520,7 @@ export const foxgloveMessageSchemas = { Color, CompressedImage, CompressedVideo, + CompressedAudio, CylinderPrimitive, CubePrimitive, FrameTransform, diff --git a/package.json b/package.json index 787aedb..4992a43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@foxglove/schemas", - "version": "1.6.6", + "version": "1.6.7", "description": "Foxglove-defined message schemas for ROS, Protobuf, FlatBuffers, OMG IDL, and JSON", "license": "MIT", "repository": { diff --git a/ros_foxglove_msgs/ros1/CompressedAudio.msg b/ros_foxglove_msgs/ros1/CompressedAudio.msg new file mode 100644 index 0000000..3680dd2 --- /dev/null +++ b/ros_foxglove_msgs/ros1/CompressedAudio.msg @@ -0,0 +1,26 @@ +# foxglove_msgs/CompressedAudio +# A single frame of a compressed audio bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of audio frame +time timestamp + +# Compressed audio frame data. +uint8[] data + +# Audio format. +# +# Supported values: `opus`. +string format + +# Frame type. +# +# Supported values: `key`, `delta`. +string type + +# Number of audio samples per second. +uint32 sample_rate + +# Number of audio channels in the input. +uint32 number_of_channels diff --git a/ros_foxglove_msgs/ros2/CompressedAudio.msg b/ros_foxglove_msgs/ros2/CompressedAudio.msg new file mode 100644 index 0000000..a03030f --- /dev/null +++ b/ros_foxglove_msgs/ros2/CompressedAudio.msg @@ -0,0 +1,26 @@ +# foxglove_msgs/msg/CompressedAudio +# A single frame of a compressed audio bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of audio frame +builtin_interfaces/Time timestamp + +# Compressed audio frame data. +uint8[] data + +# Audio format. +# +# Supported values: `opus`. +string format + +# Frame type. +# +# Supported values: `key`, `delta`. +string type + +# Number of audio samples per second. +uint32 sample_rate + +# Number of audio channels in the input. +uint32 number_of_channels diff --git a/schemas/README.md b/schemas/README.md index 3dfd5a6..0a5d1fb 100644 --- a/schemas/README.md +++ b/schemas/README.md @@ -16,6 +16,7 @@ All schemas are generated from [schemas.ts](/internal/schemas.ts). - [CameraCalibration](#cameracalibration) - [CircleAnnotation](#circleannotation) - [Color](#color) +- [CompressedAudio](#compressedaudio) - [CompressedImage](#compressedimage) - [CompressedVideo](#compressedvideo) - [CubePrimitive](#cubeprimitive) @@ -550,6 +551,100 @@ Alpha value between 0 and 1 +## CompressedAudio + +A single frame of a compressed audio bitstream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fieldtypedescription
timestamp + +time + + + +Timestamp of audio frame + +
data + +bytes + + + +Compressed audio frame data. + +
format + +string + + + +Audio format. + +Supported values: `opus`. + +
type + +string + + + +Frame type. + + Supported values: `key`, `delta`. + +
sample_rate + +uint32 + + + +Number of audio samples per second. + +
number_of_channels + +uint32 + + + +Number of audio channels in the input. + +
+ ## CompressedImage A compressed image diff --git a/schemas/flatbuffer/CompressedAudio.fbs b/schemas/flatbuffer/CompressedAudio.fbs new file mode 100644 index 0000000..fbee197 --- /dev/null +++ b/schemas/flatbuffer/CompressedAudio.fbs @@ -0,0 +1,32 @@ +// Generated by https://github.com/foxglove/schemas + +include "Time.fbs"; + +namespace foxglove; + +/// A single frame of a compressed audio bitstream +table CompressedAudio { + /// Timestamp of audio frame + timestamp:Time (id: 0); + + /// Compressed audio frame data. + data:[uint8] (id: 1); + + /// Audio format. + /// + /// Supported values: `opus`. + format:string (id: 2); + + /// Frame type. + /// + /// Supported values: `key`, `delta`. + type:string (id: 3); + + /// Number of audio samples per second. + sample_rate:uint32 (id: 4); + + /// Number of audio channels in the input. + number_of_channels:uint32 (id: 5); +} + +root_type CompressedAudio; diff --git a/schemas/jsonschema/CompressedAudio.json b/schemas/jsonschema/CompressedAudio.json new file mode 100644 index 0000000..835be23 --- /dev/null +++ b/schemas/jsonschema/CompressedAudio.json @@ -0,0 +1,47 @@ +{ + "title": "foxglove.CompressedAudio", + "description": "A single frame of a compressed audio bitstream", + "$comment": "Generated by https://github.com/foxglove/schemas", + "type": "object", + "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of audio frame" + }, + "data": { + "type": "string", + "contentEncoding": "base64", + "description": "Compressed audio frame data." + }, + "format": { + "type": "string", + "description": "Audio format.\n\nSupported values: `opus`." + }, + "type": { + "type": "string", + "description": "Frame type.\n\n Supported values: `key`, `delta`." + }, + "sample_rate": { + "type": "integer", + "minimum": 0, + "description": "Number of audio samples per second." + }, + "number_of_channels": { + "type": "integer", + "minimum": 0, + "description": "Number of audio channels in the input." + } + } +} diff --git a/schemas/jsonschema/index.ts b/schemas/jsonschema/index.ts index 22da45f..e8ffa52 100644 --- a/schemas/jsonschema/index.ts +++ b/schemas/jsonschema/index.ts @@ -369,6 +369,54 @@ export const CompressedVideo = { } }; +export const CompressedAudio = { + "title": "foxglove.CompressedAudio", + "description": "A single frame of a compressed audio bitstream", + "$comment": "Generated by https://github.com/foxglove/schemas", + "type": "object", + "properties": { + "timestamp": { + "type": "object", + "title": "time", + "properties": { + "sec": { + "type": "integer", + "minimum": 0 + }, + "nsec": { + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "description": "Timestamp of audio frame" + }, + "data": { + "type": "string", + "contentEncoding": "base64", + "description": "Compressed audio frame data." + }, + "format": { + "type": "string", + "description": "Audio format.\n\nSupported values: `opus`." + }, + "type": { + "type": "string", + "description": "Frame type.\n\n Supported values: `key`, `delta`." + }, + "sample_rate": { + "type": "integer", + "minimum": 0, + "description": "Number of audio samples per second." + }, + "number_of_channels": { + "type": "integer", + "minimum": 0, + "description": "Number of audio channels in the input." + } + } +}; + export const CylinderPrimitive = { "title": "foxglove.CylinderPrimitive", "description": "A primitive representing a cylinder, elliptic cylinder, or truncated cone", diff --git a/schemas/omgidl/foxglove/CompressedAudio.idl b/schemas/omgidl/foxglove/CompressedAudio.idl new file mode 100644 index 0000000..0ca8c1c --- /dev/null +++ b/schemas/omgidl/foxglove/CompressedAudio.idl @@ -0,0 +1,32 @@ +// Generated by https://github.com/foxglove/schemas + +#include "foxglove/Time.idl" + +module foxglove { + +// A single frame of a compressed audio bitstream +struct CompressedAudio { + // Timestamp of audio frame + Time timestamp; + + // Compressed audio frame data. + sequence data; + + // Audio format. + // + // Supported values: `opus`. + string format; + + // Frame type. + // + // Supported values: `key`, `delta`. + string type; + + // Number of audio samples per second. + uint32 sample_rate; + + // Number of audio channels in the input. + uint32 number_of_channels; +}; + +}; diff --git a/schemas/proto/foxglove/CompressedAudio.proto b/schemas/proto/foxglove/CompressedAudio.proto new file mode 100644 index 0000000..4aa5f83 --- /dev/null +++ b/schemas/proto/foxglove/CompressedAudio.proto @@ -0,0 +1,32 @@ +// Generated by https://github.com/foxglove/schemas + +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; + +package foxglove; + +// A single frame of a compressed audio bitstream +message CompressedAudio { + // Timestamp of audio frame + google.protobuf.Timestamp timestamp = 1; + + // Compressed audio frame data. + bytes data = 2; + + // Audio format. + // + // Supported values: `opus`. + string format = 3; + + // Frame type. + // + // Supported values: `key`, `delta`. + string type = 4; + + // Number of audio samples per second. + fixed32 sample_rate = 5; + + // Number of audio channels in the input. + fixed32 number_of_channels = 6; +} diff --git a/schemas/ros1/CompressedAudio.msg b/schemas/ros1/CompressedAudio.msg new file mode 100644 index 0000000..3680dd2 --- /dev/null +++ b/schemas/ros1/CompressedAudio.msg @@ -0,0 +1,26 @@ +# foxglove_msgs/CompressedAudio +# A single frame of a compressed audio bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of audio frame +time timestamp + +# Compressed audio frame data. +uint8[] data + +# Audio format. +# +# Supported values: `opus`. +string format + +# Frame type. +# +# Supported values: `key`, `delta`. +string type + +# Number of audio samples per second. +uint32 sample_rate + +# Number of audio channels in the input. +uint32 number_of_channels diff --git a/schemas/ros2/CompressedAudio.msg b/schemas/ros2/CompressedAudio.msg new file mode 100644 index 0000000..a03030f --- /dev/null +++ b/schemas/ros2/CompressedAudio.msg @@ -0,0 +1,26 @@ +# foxglove_msgs/msg/CompressedAudio +# A single frame of a compressed audio bitstream + +# Generated by https://github.com/foxglove/schemas + +# Timestamp of audio frame +builtin_interfaces/Time timestamp + +# Compressed audio frame data. +uint8[] data + +# Audio format. +# +# Supported values: `opus`. +string format + +# Frame type. +# +# Supported values: `key`, `delta`. +string type + +# Number of audio samples per second. +uint32 sample_rate + +# Number of audio channels in the input. +uint32 number_of_channels diff --git a/schemas/typescript/CompressedAudio.ts b/schemas/typescript/CompressedAudio.ts new file mode 100644 index 0000000..0d13260 --- /dev/null +++ b/schemas/typescript/CompressedAudio.ts @@ -0,0 +1,33 @@ +// Generated by https://github.com/foxglove/schemas +// Options: {} + +import { Time } from "./Time"; + +/** A single frame of a compressed audio bitstream */ +export type CompressedAudio = { + /** Timestamp of audio frame */ + timestamp: Time; + + /** Compressed audio frame data. */ + data: Uint8Array; + + /** + * Audio format. + * + * Supported values: `opus`. + */ + format: string; + + /** + * Frame type. + * + * Supported values: `key`, `delta`. + */ + type: string; + + /** Number of audio samples per second. */ + sample_rate: number; + + /** Number of audio channels in the input. */ + number_of_channels: number; +}; diff --git a/schemas/typescript/index.ts b/schemas/typescript/index.ts index 17d8755..3d03544 100644 --- a/schemas/typescript/index.ts +++ b/schemas/typescript/index.ts @@ -2,6 +2,7 @@ export * from "./ArrowPrimitive"; export * from "./CameraCalibration"; export * from "./CircleAnnotation"; export * from "./Color"; +export * from "./CompressedAudio"; export * from "./CompressedImage"; export * from "./CompressedVideo"; export * from "./CubePrimitive";