public struct AudioSourceA sound attached to an entity.
No guide page documents this yet — the page shows what the code says about itself.
As a scene component
- Size
- 48 bytes — 273 rows in a 16 KB chunk, alone on the archetype
Remarks
Unmanaged, so a scene full of emitters is a sweep over chunks. The clip itself is a reference and lives in AudioClipRef beside it — one indirection, taken once when a sound starts rather than once per entity per frame.
A zeroed AudioSource is silent and stopped, which is why Default exists: default gives a gain of zero and a pitch of zero, and a pitch of zero is a sound that never advances. Anything creating one by hand starts from Default, exactly as LocalTransform.Identity does.
Fields and properties (12)
public AudioPlayback PlaybackWhat it should be doing.
public int BusWhich bus it routes into. Zero is the master.
public float GainIts linear gain.
public float PitchIts playback rate multiplier.
public float PanWhere it sits between the speakers, when it is not spatialised.
public bool LoopWhether it wraps round instead of ending.
public int PriorityHow hard it is to displace when the voice pool is full. Higher survives.
public VoiceHandle VoiceThe voice it is playing on. Written by the system; read by anything that wants the detail.
public float VoiceGainScaleWhat the sound that started decided its own gain was. Owned by the system.
public float VoicePitchScaleWhat the sound that started decided its own pitch ratio was. Owned by the system.
public static AudioSource DefaultFull volume, unaltered pitch, centred, on the master bus, stopped.
public static AudioSource PlayingThe same, already playing.
Used by (13)
- AudioEventSystemTestsVixen.Audio.Tests
- AudioSystemVixen.Audio
- AudioSystemTestsVixen.Audio.Tests
- ComponentRegistrationVixen.Audio
- NetworkAudioApplySystemVixen.Net.Audio
- NetworkAudioCaptureSystemVixen.Net.Audio
- NetworkAudioTestsVixen.Net.Audio.Tests
- TypeRegistrationVixen.Audio
- Vixen_Audio_Ecs_AudioSourceSerializerVixen.Audio
- AddComponentMenuTestsVixen.Editor.App.Tests
- ComponentTestsVixen.Editor.App.Tests
- EditorApplicationVixen.Editor.App
- MaterialIconsVixen.Editor.App