audSetChannelPosition

Updates the 3D position of a playing sound channel. Takes channel (channel handle), x/y/z (new 3D position coordinates). Returns nothing.

Audio

Parameters & Returns

Parameters

channel Int
x Double
y Double
z Double

Returns

Void

Quick Summary

Updates the 3D position of a playing sound channel. Takes channel (channel handle), x/y/z (new 3D position coordinates). Returns nothing.

Technical Exegesis...

Sets or updates the 3D position of an active channel to coordinates (x, y, z). The volume and panning are recalculated based on the new position relative to the listener.

Does nothing if the channel handle is invalid or <= 0. Use this to move sounds dynamically, such as updating the position of a moving vehicle or projectile each frame. Only works for channels created with audPlaySound3D or audPlayMusic3D.

Example

Example.bam
SetChannelPosition(channel, sourceX, sourceY, sourceZ)