s&box docs

public static abstract sealed class Sandbox.Sound

Single source for creating sounds

Broader workflow and conceptual references connected to this API.

Methods

Showing 11 methods

public static void Preload(string eventName)

Precaches sound files associated with given sound event by name. This helps avoid stutters on first load of each sound file.

public static void SetEffect(string name, float value, float velocity = 10, float fadeOut = -1)Obsolete

Obsolete: This API member is obsolete.

Parameters

  • velocity: Default: 10
  • fadeOut: Default: -1

public static void StopAll(float fade)

public static void UncompressVoiceData(byte[] buffer, System.Action`1<System.Memory`1<short>> ondata)

Properties

Showing 4 properties

public static string[] Sandbox.Sound.DspNames { get; set; }

Get a list of available DSP names

public static Transform Sandbox.Sound.Listener { get; set; }

Sound listener of the active scene.

public static float Sandbox.Sound.MasterVolume { get; set; }

The user's preference for their master volume.

public static int Sandbox.Sound.VoiceSampleRate { get; set; }

The sample rate for voice data

Metadata

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

On this page

Methodspublic static Sandbox.SoundHandle Play(Sandbox.SoundEvent soundEvent, System.Single fadeInTime = 0)public static Sandbox.SoundHandle Play(Sandbox.SoundEvent soundEvent, Vector3 position, System.Single fadeInTime = 0)public static Sandbox.SoundHandle Play(System.String eventName, Sandbox.Audio.Mixer mixer)public static Sandbox.SoundHandle Play(System.String eventName, System.Single fadeInTime = 0)public static Sandbox.SoundHandle Play(System.String eventName, Vector3 position, System.Single fadeInTime = 0)public static Sandbox.SoundHandle PlayFile(Sandbox.SoundFile soundFile, System.Single volume, System.Single pitch, System.Single decibels, System.Single delay, System.Single fadeInTime = 0)public static Sandbox.SoundHandle PlayFile(Sandbox.SoundFile soundFile, System.Single volume = 1, System.Single pitch = 1, System.Single delay = 0, System.Single fadeInTime = 0)public static System.Void Preload(System.String eventName)public static System.Void SetEffect(System.String name, System.Single value, System.Single velocity = 10, System.Single fadeOut = -1)public static System.Void StopAll(System.Single fade)public static System.Void UncompressVoiceData(System.Byte[] buffer, System.Action`1<System.Memory`1<System.Int16>> ondata)Propertiespublic static System.String[] Sandbox.Sound.DspNames { get; set; }public static Transform Sandbox.Sound.Listener { get; set; }public static System.Single Sandbox.Sound.MasterVolume { get; set; }public static System.Int32 Sandbox.Sound.VoiceSampleRate { get; set; }Metadata