API ReferenceSandbox
public class Sandbox.SoundFile : Sandbox.Resource
A sound resource.
Methods
Showing 8 methods
protected virtual override void Finalize()
public static Sandbox.SoundFile FromMp3(string filename, System.Span`1<byte> data, bool loop)
public static Sandbox.SoundFile FromPcm(string filename, System.Span`1<byte> data, int channels, uint rate, int bits, bool loop)
public static Sandbox.SoundFile FromWav(string filename, System.Span`1<byte> data, bool loop)
public System.Threading.Tasks.Task`1<short[]> GetSamplesAsync()
Request decompressed audio samples.
public static Sandbox.SoundFile Load(string filename)
Load a new sound from disk. Includes automatic caching.
Parameters
filename: The file path to load the sound from.
Returns
The loaded sound file, or null if failed.
public System.Threading.Tasks.Task`1<bool> LoadAsync()
public void Preload()
No results match this filter.
Properties
Showing 11 properties
public int Sandbox.SoundFile.BitsPerSample { get; set; }
Bits per each sample of this sound file.
public int Sandbox.SoundFile.BytesPerSample { get; set; }
Bytes per each sample of this sound file.
public int Sandbox.SoundFile.Channels { get; set; }
Number of channels this audio file has.
public float Sandbox.SoundFile.Duration { get; set; }
Duration of the sound this sound file contains, in seconds.
public Sandbox.SoundFormat Sandbox.SoundFile.Format { get; set; }
Format of the audio file.
public bool Sandbox.SoundFile.IsLoaded { get; set; }
true if sound is loaded
public virtual bool Sandbox.SoundFile.IsValid { get; set; }
public bool Sandbox.SoundFile.IsValidForPlayback { get; set; }
public System.Action Sandbox.SoundFile.OnSoundReloaded { get; set; }
Ran when the file is reloaded/recompiled, etc.
public int Sandbox.SoundFile.Rate { get; set; }
Sample rate of this sound file, per second.
public int Sandbox.SoundFile.SampleFrameSize { get; set; }
Size of one sample, typically this would be "sample size * channel count", but can vary on audio format.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.SoundFile |