public sealed class Sandbox.MusicPlayer
Enables music playback. Use this for music, not for playing game sounds.
Related Guides
Broader workflow and conceptual references connected to this API.
Methods
Showing 5 methods
public virtual sealed void Dispose()
public static Sandbox.MusicPlayer Play(Sandbox.BaseFileSystem filesystem, string path)
Plays a music file from a relative path.
public static Sandbox.MusicPlayer PlayUrl(string url)
Plays a music stream from a URL.
public void Seek(float time)
Sets the playback position to a specified time in the audio, given in seconds.
public void Stop()
Stops audio playback.
No results match this filter.
Properties
Showing 19 properties
public float Sandbox.MusicPlayer.Amplitude { get; set; }
Approximate measure of audio loudness.
public int Sandbox.MusicPlayer.Channels { get; set; }
Number of channels of the audio being played.
public float Sandbox.MusicPlayer.Distance { get; set; }
public float Sandbox.MusicPlayer.Duration { get; set; }
Gets the total duration of the video in seconds.
public Sandbox.Curve Sandbox.MusicPlayer.Falloff { get; set; }
public bool Sandbox.MusicPlayer.LipSync { get; set; }
Enables lipsync processing.
public bool Sandbox.MusicPlayer.ListenLocal { get; set; }
Place the listener at 0,0,0 facing 1,0,0.
public System.Action Sandbox.MusicPlayer.OnFinished { get; set; }
Invoked when the audio has finished playing.
public System.Action Sandbox.MusicPlayer.OnRepeated { get; set; }
Invoked when the audio has repeated.
public bool Sandbox.MusicPlayer.Paused { get; set; }
Pause playback of audio.
public float Sandbox.MusicPlayer.PlaybackTime { get; set; }
Gets the current playback time in seconds.
public Vector3 Sandbox.MusicPlayer.Position { get; set; }
Position of the sound.
public bool Sandbox.MusicPlayer.Repeat { get; set; }
Audio will repeat when reaching the end.
public int Sandbox.MusicPlayer.SampleRate { get; set; }
Sample rate of the audio being played.
public System.ReadOnlySpan`1<float> Sandbox.MusicPlayer.Spectrum { get; set; }
512 FFT magnitudes used for audio visualization.
public Sandbox.Audio.Mixer Sandbox.MusicPlayer.TargetMixer { get; set; }
Which mixer do we want to write to
public string Sandbox.MusicPlayer.Title { get; set; }
Get title of the track.
public System.Collections.Generic.IReadOnlyList`1<float> Sandbox.MusicPlayer.Visemes { get; set; }
A list of 15 lipsync viseme weights. Requires `Sandbox.MusicPlayer.LipSync` to be enabled.
public float Sandbox.MusicPlayer.Volume { get; set; }
Change the volume of this music.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.MusicPlayer |