Systems

Audio

91 symbols, imported from @driftengine/audio.

Explained in Your first game.

Classes

AmbientLoop
AmbisonicSoundfield
AudioGraph
AudioListenerGraph
KickDetector
MixBus
MixConsole
ProbeScheduler
When a source is allowed to ask the world whether something is in the way.
RenderedPulse
ReverbZone
SoundRegistry
SourceZoneSend
A source's own routing into one zone's return.
SpatialSource
TapTempo
Tempo and phase, from somebody tapping along.

Interfaces

AmbienceOptions
A continuous environmental bed, built to loop without a seam.
AmbisonicOptions
AudioGraphOptions
The audio graph: layered stems into a master filter, with parallel sends.
Band
The frequency bands every rhythm detector in the engine reads.
BandEnergies
Energy in each band, 0–1, filled in place so nothing allocates per hop.
BeatMap
Offline rhythm analysis: where the kicks are in a whole track.
BusOptions
DefaultLayout
The mix as it has always been, expressed in buses and inserts.
DelayInsert
InsertOptions
KickDetectorNodes
LiftInsert
MasterFilterInsert
MixConsoleOptions
The mixer: a tree of buses, and the one place that can answer a question about all of them.
MixInsert
A stage a bus can put in its own signal path. Internally it may be anything, including parallel.
MixLevels
The two levels a player is given control of: the score, and everything else.
MixSnapshot
A mix, remembered: every fader, every mute and every send, at one instant.
SlamInsert
SoundSource
SpatialOptions
A sound placed in the world, heard from where the listener is standing.
ZoneOptions
ZoneShape
A space the listener can be inside, and the tail it lends to everything heard there.

Functions

addReverbZone
Register a space. Its convolver is built here and never on entry.
ambienceBuffer
ambisonicFromWorld
A direction in this engine's world axes, as the ambisonic frame reads it.
analyseTrack
audioCandidateUrls
Every filename a named slot answers to. Feed the result to SoundSource.urls, which tries them in order and takes the first that loads.
audioContextConstructor
The live-context constructor this browser has, prefixed or not.
beatGrid
A beat map from a tempo the player supplies rather than one we detected.
claimPlaybackSession
Tell WebKit that this page's audio is the point of it, before any context exists.
convolverInsert
A convolver, built once at registration.
createAmbisonicSoundfield
Build a soundfield and place it around the listener. The shape createSpatialSource sets.
createListener
The listener for a console. One per mix; everything placed in the world reads it.
createSpatialSource
Place a sound in the world. See SpatialSource for when this is the right tool and when it is not.
cutoffForSpeed
Master low-pass cutoff in Hz for a given speed.
defaultLayout
delayInsert
A delay line that feeds itself, at a level that must decay.
distanceGain
Level for a source distance away, reaching exactly zero at radius.
driftScrapeBuffer
A skate scrape: the sound of an edge losing its bite.
emptyBeatMap
A map with no beats in it, for when there is no music to analyse.
encodeFoa
Encode a mono signal arriving from a world direction into a first-order field.
fetchAudioManifest
Every name in a manifest, or an empty list if there is not one.
fireLoopBuffer
Fire: a broadband hiss with sparks over it.
foaDecodeGain
How much of a field a speaker in a world direction should be given.
foaDecodeMatrix
The decode matrix: four coefficients per speaker, in ACN order, ready to be uploaded as gains.
impulseResponse
A synthesised impulse response: exponentially decaying noise.
kickPulseAfter
Envelope of a pulse of peak strength, seconds after it fired.
liftInsert
The lift: a high-pass and a duck, in series.
masterFilterInsert
The master low-pass: everything the player hears, including the world's own sound.
metalBuffer
A struck metal ring: inharmonic partials over a bright transient.
noiseBuffer
Placeholder buffer synthesis: the stand-in a sound slot uses until a real file exists for it.
occlusionCutoffHz
Geometric, for the reason liftFrequencyHz gives. Open above hearing, shut at 500 Hz.
occlusionGainFor
Level for a given occlusion. 1 clear, SHUT_GAIN solid, linear between.
parseAudioManifest
Validate a manifest's contents.
silentBuffer
Silence, for a slot whose only honest placeholder is nothing at all.
slamInsert
The slam: a parallel band of driven low end, blended in for a fraction of a second and gone.
smoothToward
Exponential approach, in time.
stereoPan
Where a source sits across the stereo field, from a listener facing yaw.
toneBuffer
A pitched blip: a sine sweep, for anything that should read as a signal.
waterLoopBuffer
Water: a slow, dark wash that breathes.
windLoopBuffer
Wind: mid-heavy rush, swelling harder and faster than water.

Types

AudioFormat
BandName
FetchLike
Injectable so the resolution rules can be tested without a network.
OcclusionProbe
How blocked the straight line between two points is: 0 clear, 1 solid.
SoundOrigin
How a slot ended up being filled. Useful in dev to see what is still synth.
SoundSlot
Named sound slots, resolved once at load: real file if present, synthesised buffer if not — or, for a slot registered with no stand-in, a loud failure.

Constants

ACN_W
Where each component sits in an ACN-ordered first-order field.
ACN_X
ACN_Y
ACN_Z
AUDIO_FORMATS
Audio formats a slot will accept, in preference order.
FOA_CHANNELS
How many channels a first-order field carries.
FOA_SPEAKERS
The virtual speaker layout: the six world axes, in this engine's own frame.
MASTER_OPEN_HZ
Where the master low-pass stands until somebody moves it: open, at the top of its range.
MAX_OPEN_ZONES
How many zones may sound at once.
RHYTHM_BANDS