Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sound handling

cinnabar:extension/sound-handling@0.1.0

Requested sound playback before it starts, for handle-sound.

Grants: audio to run handle-sound; this interface only defines handler types.

Types

position

World coordinates in blocks; absent for non-positional playback.

record position {
    x: f32,
    y: f32,
    z: f32,
}
MemberTypeDescription
xf32
yf32
zf32

sound-context

One new playback request after event routing to an exact sound definition. Only cancelled is changeable.

record sound-context {
    name: string,
    position: option<position>,
    looping: bool,
    cancelled: bool,
}
MemberTypeDescription
namestringExact definition name, at most 128 UTF-8 bytes.
positionoption<position>Requested world location; none is non-positional playback.
loopingboolWhether this request starts a repeating voice.
cancelledboolWhether the request is discarded; false unless an earlier handler cancelled it.

Types: position.

Functions

This interface defines shared types and has no functions.