s&box docs

public sealed class Sandbox.MusicPlayer

Enables music playback. Use this for music, not for playing game sounds.

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.

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 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 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 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.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.MusicPlayer

On this page

Methodspublic virtual sealed System.Void Dispose()public static Sandbox.MusicPlayer Play(Sandbox.BaseFileSystem filesystem, System.String path)public static Sandbox.MusicPlayer PlayUrl(System.String url)public System.Void Seek(System.Single time)public System.Void Stop()Propertiespublic System.Single Sandbox.MusicPlayer.Amplitude { get; set; }public System.Int32 Sandbox.MusicPlayer.Channels { get; set; }public System.Single Sandbox.MusicPlayer.Distance { get; set; }public System.Single Sandbox.MusicPlayer.Duration { get; set; }public Sandbox.Curve Sandbox.MusicPlayer.Falloff { get; set; }public System.Boolean Sandbox.MusicPlayer.LipSync { get; set; }public System.Boolean Sandbox.MusicPlayer.ListenLocal { get; set; }public System.Action Sandbox.MusicPlayer.OnFinished { get; set; }public System.Action Sandbox.MusicPlayer.OnRepeated { get; set; }public System.Boolean Sandbox.MusicPlayer.Paused { get; set; }public System.Single Sandbox.MusicPlayer.PlaybackTime { get; set; }public Vector3 Sandbox.MusicPlayer.Position { get; set; }public System.Boolean Sandbox.MusicPlayer.Repeat { get; set; }public System.Int32 Sandbox.MusicPlayer.SampleRate { get; set; }public System.ReadOnlySpan`1<System.Single> Sandbox.MusicPlayer.Spectrum { get; set; }public Sandbox.Audio.Mixer Sandbox.MusicPlayer.TargetMixer { get; set; }public System.String Sandbox.MusicPlayer.Title { get; set; }public System.Collections.Generic.IReadOnlyList`1<System.Single> Sandbox.MusicPlayer.Visemes { get; set; }public System.Single Sandbox.MusicPlayer.Volume { get; set; }Metadata