Systems
Audio
91 symbols, imported from @driftengine/audio.
Explained in Your first game.
Classes
AmbientLoopAmbisonicSoundfieldAudioGraphAudioListenerGraphKickDetectorMixBusMixConsoleProbeScheduler- When a source is allowed to ask the world whether something is in the way.
RenderedPulseReverbZoneSoundRegistrySourceZoneSend- A source's own routing into one zone's return.
SpatialSourceTapTempo- Tempo and phase, from somebody tapping along.
Interfaces
AmbienceOptions- A continuous environmental bed, built to loop without a seam.
AmbisonicOptionsAudioGraphOptions- 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.
BusOptionsDefaultLayout- The mix as it has always been, expressed in buses and inserts.
DelayInsertInsertOptionsKickDetectorNodesLiftInsertMasterFilterInsertMixConsoleOptions- 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.
SlamInsertSoundSourceSpatialOptions- A sound placed in the world, heard from where the listener is standing.
ZoneOptionsZoneShape- 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.
ambienceBufferambisonicFromWorld- A direction in this engine's world axes, as the ambisonic frame reads it.
analyseTrackaudioCandidateUrls- 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
createSpatialSourcesets. createListener- The listener for a console. One per mix; everything placed in the world reads it.
createSpatialSource- Place a sound in the world. See
SpatialSourcefor when this is the right tool and when it is not. cutoffForSpeed- Master low-pass cutoff in Hz for a given speed.
defaultLayoutdelayInsert- A delay line that feeds itself, at a level that must decay.
distanceGain- Level for a source
distanceaway, reaching exactly zero atradius. 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
peakstrength,secondsafter 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
liftFrequencyHzgives. Open above hearing, shut at 500 Hz. occlusionGainFor- Level for a given occlusion. 1 clear,
SHUT_GAINsolid, 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
AudioFormatBandNameFetchLike- 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_XACN_YACN_ZAUDIO_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