MusicSourceComponent Class
Definition¶
Namespace: Brine2D.Systems.Audio
Audio source for streaming background music. Only one music track plays at a time — starting music from a second entity replaces the previous one.
public class MusicSourceComponent : Brine2D.Systems.Audio.AudioSourceComponent
Inheritance System.Object → Component → AudioSourceComponent → MusicSourceComponent
Remarks¶
Spatial audio is not applicable to music. The AudioSystem processes spatial properties only for SoundEffectSourceComponent.
| Properties | |
|---|---|
| CrossfadeDuration | Duration in seconds for crossfading when this music entity replaces another. Zero means instant switch. Negative values are clamped to zero. |
| FadeOutDuration | Duration in seconds for fading out when TriggerStop is consumed. Zero means immediate stop. Negative values are clamped to zero. |
| LoopStartMs | When looping, the track loops back to this position in milliseconds instead of the beginning. This allows an intro section before the loop point. Negative values are clamped to zero. Default 0. |
| Music | Music to play (looping background music). |
| SeekPositionMs | Target position in milliseconds for TriggerSeek. Negative values are clamped to zero by the audio service. |
| TriggerSeek | Set to true to seek to SeekPositionMs on the next frame. Consumed and reset to false by AudioSystem each update. |