MusicPlayerclass
Enables music playback. Use this for music, not for playing game sounds.
Methods5
Showing 5 methods
public virtual sealed void Dispose()
void—public static Sandbox.MusicPlayer Play(Sandbox.BaseFileSystem filesystem, string path)
Plays a music file from a relative path.
| Parameter | Type | Description |
|---|---|---|
| filesystem | BaseFileSystem | — |
| path | string | — |
public static Sandbox.MusicPlayer PlayUrl(string url)
Plays a music stream from a URL.
| Parameter | Type | Description |
|---|---|---|
| url | string | — |
public void Seek(float time)
Sets the playback position to a specified time in the audio, given in seconds.
| Parameter | Type | Description |
|---|---|---|
| time | float | — |
void—public void Stop()
Stops audio playback.
void—No results match this filter.
Properties19
Showing 19 properties
public float Sandbox.MusicPlayer.Amplitude { get; set; }
Approximate measure of audio loudness.
float—public int Sandbox.MusicPlayer.Channels { get; set; }
Number of channels of the audio being played.
int—public float Sandbox.MusicPlayer.Distance { get; set; }
float—public float Sandbox.MusicPlayer.Duration { get; set; }
Gets the total duration of the video in seconds.
float—public Sandbox.Curve Sandbox.MusicPlayer.Falloff { get; set; }
public bool Sandbox.MusicPlayer.LipSync { get; set; }
Enables lipsync processing.
bool—public bool Sandbox.MusicPlayer.ListenLocal { get; set; }
Place the listener at 0,0,0 facing 1,0,0.
bool—public System.Action Sandbox.MusicPlayer.OnFinished { get; set; }
Invoked when the audio has finished playing.
Action—public System.Action Sandbox.MusicPlayer.OnRepeated { get; set; }
Invoked when the audio has repeated.
Action—public bool Sandbox.MusicPlayer.Paused { get; set; }
Pause playback of audio.
bool—public float Sandbox.MusicPlayer.PlaybackTime { get; set; }
Gets the current playback time in seconds.
float—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.
bool—public int Sandbox.MusicPlayer.SampleRate { get; set; }
Sample rate of the audio being played.
int—public System.ReadOnlySpan`1<float> Sandbox.MusicPlayer.Spectrum { get; set; }
512 FFT magnitudes used for audio visualization.
ReadOnlySpan<float>—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.
string—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.
IReadOnlyList<float>—public float Sandbox.MusicPlayer.Volume { get; set; }
Change the volume of this music.
float—No results match this filter.