PlayOpts
Defined in: packages/threeplay/src/plugins/audio/types.ts:5
Options of play().
Properties
Section titled “Properties”Defined in: packages/threeplay/src/plugins/audio/types.ts:20
Positional sound at a point or following an object (attenuates with
distance to the camera, pans with its orientation). A vector is read
every frame, so mutating it moves the sound. When the object is destroyed
a one-shot sound finishes where it was, but a loop sound stops with it.
detune?
Section titled “detune?”
optionaldetune?:number
Defined in: packages/threeplay/src/plugins/audio/types.ts:13
Detune in cents.
optionalloop?:boolean
Defined in: packages/threeplay/src/plugins/audio/types.ts:9
Repeat until stopped.
panning?
Section titled “panning?”
optionalpanning?:"HRTF"|"equalpower"
Defined in: packages/threeplay/src/plugins/audio/types.ts:22
Spatialization model for positional sounds (default "HRTF"; "equalpower" is cheaper).
refDistance?
Section titled “refDistance?”
optionalrefDistance?:number
Defined in: packages/threeplay/src/plugins/audio/types.ts:24
Distance at which a positional sound starts to attenuate (default 1).
rolloff?
Section titled “rolloff?”
optionalrolloff?:number
Defined in: packages/threeplay/src/plugins/audio/types.ts:26
How fast a positional sound fades with distance (inverse model, default 1).
speed?
Section titled “speed?”
optionalspeed?:number
Defined in: packages/threeplay/src/plugins/audio/types.ts:11
Playback rate (default 1).
volume?
Section titled “volume?”
optionalvolume?:number
Defined in: packages/threeplay/src/plugins/audio/types.ts:7
Gain 0–1 (default 1).