# Sandbox.SoundFile

A sound resource.

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Resource](/api/Sandbox.Resource)

## Properties

- [`BitsPerSample`](/api/Sandbox.SoundFile/BitsPerSample): Bits per each sample of this sound file.
- [`BytesPerSample`](/api/Sandbox.SoundFile/BytesPerSample): Bytes per each sample of this sound file.
- [`Channels`](/api/Sandbox.SoundFile/Channels): Number of channels this audio file has.
- [`Duration`](/api/Sandbox.SoundFile/Duration): Duration of the sound this sound file contains, in seconds.
- [`Format`](/api/Sandbox.SoundFile/Format): Format of the audio file.
- [`IsLoaded`](/api/Sandbox.SoundFile/IsLoaded): true if sound is loaded
- [`IsValid`](/api/Sandbox.SoundFile/IsValid)
- [`IsValidForPlayback`](/api/Sandbox.SoundFile/IsValidForPlayback)
- [`Rate`](/api/Sandbox.SoundFile/Rate): Sample rate of this sound file, per second.
- [`SampleFrameSize`](/api/Sandbox.SoundFile/SampleFrameSize): Size of one sample, typically this would be "sample size * channel count", but can vary on audio format.
- [`Subtitles`](/api/Sandbox.SoundFile/Subtitles): The subtitle track for this sound, or null if it doesn't have one. Authored in the sound editor's timeline as individual words, so you can show them word by word as the sound plays. Read from the compiled file when the sound resource loads - check [Sandbox.SoundFile.IsValidForPlayback](/api/Sandbox.SoundFile/IsValidForPlayback) to tell "no track" apart from "not loaded yet".
- [`Visemes`](/api/Sandbox.SoundFile/Visemes): The lipsync track for this sound, or null if it doesn't have one. Authored in the sound editor's viseme timeline. Read from the compiled file when the sound resource loads - check [Sandbox.SoundFile.IsValidForPlayback](/api/Sandbox.SoundFile/IsValidForPlayback) to tell "no track" apart from "not loaded yet".

## Methods

- [`FromMp3`](/api/Sandbox.SoundFile/FromMp3)
- [`FromOgg`](/api/Sandbox.SoundFile/FromOgg)
- [`FromPcm`](/api/Sandbox.SoundFile/FromPcm)
- [`FromWav`](/api/Sandbox.SoundFile/FromWav)
- [`GetSamplesAsync`](/api/Sandbox.SoundFile/GetSamplesAsync): Request decompressed audio samples. Multi-channel sounds are downmixed to mono.
- [`GetSamplesInterleavedAsync`](/api/Sandbox.SoundFile/GetSamplesInterleavedAsync): Request decompressed audio samples. Stereo sounds keep both channels, interleaved (L,R,L,R..). Sounds with any other channel count are downmixed to mono.
- [`Load`](/api/Sandbox.SoundFile/Load): Load a new sound from disk. Includes automatic caching.
- [`LoadAsync`](/api/Sandbox.SoundFile/LoadAsync)
- [`Preload`](/api/Sandbox.SoundFile/Preload)
