Skip to main content

AudioSource

Client

Returned by Audio:PlaySound()

Methods​

nil Play()​

Play the sound. If already playing it will restart from begining. Paused sound will resume playback where they were paused.

nil Pause()​

Pause the sound

nil Stop()​

Stop the sound

Properties​

Vec3 pos​

Position of sound in 3D space

Vec3 velocity​

Direction of movement. Length of vector determine speed. Units is m/s Important for fast moving object. It affect doppler shift which cause that fast incoming object sounds with higher pitch.

Object followObject​

Make position of sound and this object same and keep them synced.

number volume​

Volume of the sound. Number in range 0 - 1

boolean loop​

Set to true for looping.

boolean relativePos​

number pitch​

number minDistance​

number maxDistance​

number attenuation​

boolean playing​

boolean paused​

boolean stopped​

number playbackPos​

number playbackLength​