AudioSource
AudioSource controls a resident VAG clip assigned to an Audio Source component
on the target GameObject.
| Method | Returns | Description |
|---|---|---|
AudioSource.Play(gameObjectId) | boolean | Starts or restarts tracked playback. |
AudioSource.PlayOneShot(gameObjectId) | boolean | Starts an independent one-shot voice. |
AudioSource.Stop(gameObjectId) | boolean | Stops tracked playback. |
AudioSource.SetVolume(gameObjectId, volume) | boolean | Sets normalized volume. |
AudioSource.SetPan(gameObjectId, pan) | boolean | Sets stereo pan in -1.0..1.0. |
AudioSource.IsPlaying(gameObjectId) | boolean | Reads tracked playback state. |
function Start(gameObjectId)
AudioSource.SetVolume(gameObjectId, 0.8)
AudioSource.SetPan(gameObjectId, 0.0)
end
function Impact(gameObjectId)
if not AudioSource.PlayOneShot(gameObjectId) then
Log.Print("Impact voice unavailable")
end
end
Resident clips consume SPU RAM and runtime voices. Use Music for long CD-XA streams and Audio Import for conversion and budget rules.