Skip to content

gatos.audio_control

tool Camera and media

Control named audio playback channels.

Use when
Playing a stored clip or updating/stopping an existing channel.
Availability
audio_enabled.

Input

FieldTypeRequirementDescription
operationstringRequiredLogical operation listed below. A dotted canonical action is also accepted.
valuenumberOptional · 0Operation-specific scalar.
valuesnumber[] | nullOptional · nullOperation-specific numeric vector.
tokenstring | nullOptional · nullOperation-specific named value.
auxstring | nullOptional · nullOperation-specific secondary value.

Operation call shapes

Choose an operation below. Its required payload and a complete call stay together—there is no second table to cross-reference.

play

Canonical action: audio.play

Start a clip. group is 0=sfx, 1=music, or 2=ui; end_ms 0 means the whole clip.

Arguments for this operation

{ operation: "play", token: clip_name, aux?: channel_id, values?: [start_ms, end_ms, volume, loop, pan, pitch, group] }

Example

gatos.audio_control({"operation":"play","token":"launch.wav","aux":"mission","values":[0,0,1,0,0,1,0]})

update / pause / resume / seek

Canonical action: audio.set

Patch a live channel using flat numeric key/value pairs. pause/resume/seek map to this same action.

Arguments for this operation

{ operation, token: channel_id_or_clip, values: [key, value, ...]  // 0=volume, 1=pan, 2=pitch, 3=paused, 4=seek_ms }

Example

gatos.audio_control({"operation":"update","token":"mission","values":[0,0.25,3,1]})

stop

Canonical action: audio.stop

Stop one matching channel/clip, or all channels.

Arguments for this operation

{ operation: "stop", token: "all" | channel_id | clip_name }

Example

gatos.audio_control({"operation":"stop","token":"mission"})

Call example

gatos.audio_control({"operation":"play","token":"launch.wav","aux":"mission","value":1})

Result

Audio command outcome with freshness metadata.

Errors

  • EOPNOTSUPP when audio is disabled; ENOENT for a missing clip/channel; EINVAL for invalid channel fields.