Skip to content

HeadlessAudioService Class

No-op audio service for headless mode (servers, testing). All audio operations are silently ignored. Volume properties are initialised from AudioOptions so configured values are observable in tests.

internal sealed class HeadlessAudioService : Brine2D.Audio.IAudioService, Brine2D.Audio.ISoundLoader, System.IDisposable, Brine2D.Audio.IMusicLoader, Brine2D.Audio.IAudioPlayer

Inheritance System.Object → HeadlessAudioService

Implements IAudioService, ISoundLoader, System.IDisposable, IMusicLoader, IAudioPlayer

Remarks

Because no real playback occurs, non-looping sound-effect tracks are expired on the next Brine2D.Audio.HeadlessAudioService.Update(System.Single) call. Looping tracks (loops < 0) remain alive until explicitly stopped via Brine2D.Audio.HeadlessAudioService.StopTrack(System.IntPtr) or Brine2D.Audio.HeadlessAudioService.StopBus(System.String,System.Single). Non-looping music is likewise completed on the next Brine2D.Audio.HeadlessAudioService.Update(System.Single) call.

When all tracks are in use a new sound whose priority is equal to or higher than the lowest active track will evict that track; otherwise the request is rejected.