s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
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
MusicPlayer
chevron_left
Classes
class
MusicPlayer
Properties
data_object
Amplitude
data_object
Channels
data_object
Distance
data_object
Duration
data_object
Falloff
data_object
LipSync
data_object
ListenLocal
data_object
OnFinished
data_object
OnRepeated
data_object
Paused
data_object
PlaybackTime
data_object
Position
data_object
Repeat
data_object
SampleRate
data_object
Spectrum
data_object
TargetMixer
data_object
Title
data_object
Visemes
data_object
Volume
Methods
functions
Dispose
functions
Seek
functions
Stop
Static Methods
functions
Play
functions
PlayUrl
MusicPlayer
Enables music playback. Use this for music, not for playing game sounds.
class
Sandbox
.
sealed
Sandbox.Engine
data_object
Properties
19
Amplitude
float
Approximate measure of audio loudness.
Channels
int
Number of channels of the audio being played.
Distance
float
Duration
float
Gets the total duration of the video in seconds.
Falloff
Curve
LipSync
bool
Enables lipsync processing.
ListenLocal
bool
Place the listener at 0,0,0 facing 1,0,0.
OnFinished
Action
Invoked when the audio has finished playing.
OnRepeated
Action
Invoked when the audio has repeated.
Paused
bool
Pause playback of audio.
PlaybackTime
float
Gets the current playback time in seconds.
Position
Vector3
Position of the sound.
Repeat
bool
Audio will repeat when reaching the end.
SampleRate
int
Sample rate of the audio being played.
Spectrum
ReadOnlySpan`1
512 FFT magnitudes used for audio visualization.
TargetMixer
Mixer
Which mixer do we want to write to
Title
string
Get title of the track.
Visemes
IReadOnlyList`1
A list of 15 lipsync viseme weights. Requires Sandbox.MusicPlayer.LipSync to be enabled.
Volume
float
Change the volume of this music.
functions
Methods
3
Dispose
(
)
Seek
(
time
)
Sets the playback position to a specified time in the audio, given in seconds.
Stop
(
)
Stops audio playback.
functions
Static Methods
2
Play
(
filesystem
,
path
)
MusicPlayer
Plays a music file from a relative path.
PlayUrl
(
url
)
MusicPlayer
Plays a music stream from a URL.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.