public static abstract sealed class Sandbox.Sound
Single source for creating sounds
Related Guides
Broader workflow and conceptual references connected to this API.
There is a large selection of Assets (Textures, Models, Sounds, ect) available to use on sbox.game, and you can use them without needing to think about downloading the files/mounting the content/ect.
The mount system is extensible - anyone can write a mount to add support for a new game or engine and contribute it to s&box via pull request. A mount detects a game's install directory via Steam, scans its files, and converts assets into s&box compatible assets, all at runtime.
s&box provides several ways to play sounds in code. You can fire-and-forget a sound at a world position, control it via a SoundHandle, attach it to a GameObject, or use scene components entirely.
Components can contain RPCs. An RPC is a function that when called, is called remotely too.
s&box has a full audio system including 2D/3D sound playback, voice chat, positional audio, an audio effects pipeline, and lip sync support.
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: 10fadeOut: Default: -1
public static void StopAll(float fade)
public static void UncompressVoiceData(byte[] buffer, System.Action`1<System.Memory`1<short>> ondata)
No results match this filter.
Properties
Showing 4 properties
public static string[] Sandbox.Sound.DspNames { get; set; }
Get a list of available DSP names
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
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Sound |