INNER CODE UNIT · TypeScript

setListenerPosition

Bloom-Engine/engine · src/audio/index.ts:152

export function setListenerPosition(x: number, y: number, z: number, forwardX: number, forwardY: number, forwardZ: number): void {
  bloom_set_listener_position(x, y, z, forwardX, forwardY, forwardZ);
}

// ---- EN-062: live spatial voices --------------------------------------------
//
// playSound3D is fire-and-forget — it cannot loop and it cannot move. These
// calls are the *emitter* API: play returns a voice id you hold onto and
// steer per frame. A river you walk along, wind in a treeline, a creature
// skittering closer — each is one looping voice plus a position/volume ride.
//
// What the mixer does with a spatial voice (all of it engine-side, free to
// the game): equal-power panning, inverse-distance attenuation shaped by
// refDist/rolloff, distance air-absorption, a rear-hemisphere head-shadow
// cue, and doppler derived from the motion you feed voiceSetPosition.

declare function bloom_play_sound_3d_ex(handle: number, x: number, y: number, z: number,
  looping: number, refDist: number, maxDist: number, rolloff: number): number;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…