s&
info
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
explore
Discover Games
category
Workshop
sports_esports
Games
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
menu_book
Learn
docs
Documentation
api
Api Reference
school
Tutorials
manage_search
Code Search
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
SoundFile
chevron_left
Classes
class
SoundFile
Properties
data_object
BitsPerSample
data_object
BytesPerSample
data_object
Channels
data_object
Duration
data_object
Format
data_object
IsLoaded
data_object
IsValid
data_object
IsValidForPlayback
data_object
Rate
data_object
SampleFrameSize
data_object
Subtitles
data_object
Visemes
Methods
lock
Finalize
functions
GetSamplesAsync
functions
GetSamplesInterleavedAsync
functions
LoadAsync
functions
Preload
Static Methods
functions
FromMp3
functions
FromOgg
functions
FromPcm
functions
FromWav
functions
Load
SoundFile
A sound resource.
class
Sandbox
.
account_tree
extends
Resource
Sandbox.Engine
data_object
Properties
12
BitsPerSample
int
Bits per each sample of this sound file.
BytesPerSample
int
Bytes per each sample of this sound file.
Channels
int
Number of channels this audio file has.
Duration
float
Duration of the sound this sound file contains, in seconds.
Format
SoundFormat
Format of the audio file.
IsLoaded
bool
true if sound is loaded
IsValid
bool
IsValidForPlayback
bool
Rate
int
Sample rate of this sound file, per second.
SampleFrameSize
int
Size of one sample, typically this would be "sample size * channel count", but can vary on audio format.
Subtitles
SubtitleTrack
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 to tell "no track" apart from "not loaded yet".
Visemes
VisemeTrack
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 to tell "no track" apart from "not loaded yet".
functions
Methods
5
Finalize
(
)
GetSamplesAsync
(
)
Task`1
Request decompressed audio samples. Multi-channel sounds are downmixed to mono.
GetSamplesInterleavedAsync
(
)
Task`1
Request decompressed audio samples. Stereo sounds keep both channels, interleaved (L,R,L,R..). Sounds with any other channel count are downmixed to mono.
LoadAsync
(
)
Task`1
Preload
(
)
functions
Static Methods
5
FromMp3
(
filename
,
data
,
options
)
SoundFile
FromOgg
(
filename
,
data
,
options
)
SoundFile
FromPcm
(
filename
,
data
,
options
)
SoundFile
FromWav
(
filename
,
data
,
options
)
SoundFile
Load
(
filename
)
SoundFile
Load a new sound from disk. Includes automatic caching.
Inheritance
Resource
SoundFile
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.