AudioOptions
Since 0.6
Signature
export interface AudioOptions {
loop?: boolean
bus?: AudioBus
/** 0..1 */
volume?: number
/** Playback rate; 1 is as authored. Omitted takes the asset's `meta.audio.sounds` default. */
pitch?: number
/** Spatialise at a point or follow an entity; omitted plays non-spatial. */
at?: Target
}
Import: import type { AudioOptions } from "@argus/api"
Members
| Member | Signature | Description |
|---|---|---|
loop | loop?: boolean | |
bus | bus?: AudioBus | |
volume | volume?: number | 0..1 |
pitch | pitch?: number | Playback rate; 1 is as authored. Omitted takes the asset's meta.audio.sounds default. |
at | at?: Target | Spatialise at a point or follow an entity; omitted plays non-spatial. |
Example
The tested fixture fixtures/app/agent.ts.
import type { Behavior } from "@argus/api"
// Sends a nav agent to `props.target` once, then reports arrival through ctx.state so the
// test can read it without polling the crowd directly.
export default {
init(ctx) {
ctx.state.arrived = false
ctx.nav?.goTo(ctx.props.target as [number, number, number])
},
update(ctx) {
if (ctx.nav?.arrived) ctx.state.arrived = true
},
} satisfies Behavior