Audio · function
claimPlaybackSession
Tell WebKit that this page's audio is the point of it, before any context exists.
Explained in Your first game.
function claimPlaybackSession(): voidimport { claimPlaybackSession } from '@driftengine/audio';In depth
Exported for a second consumer that cannot use AudioGraph. This class is a stem
player for a game soundtrack; an application that decodes one file and runs it through
its own chain needs this line and not the graph, and a copy of it in another repository
is a second version of an iOS behaviour that will be wrong the next time WebKit moves.
The ordering is the part a copy gets wrong and the part a diff cannot show: claimed
before the context is constructed, so the context is born into the right session.
See autoplay.test.ts for what it is for: iOS puts Web Audio in the ambient session,
which the ringer switch silences, so a page built out of AudioContext is the one kind
that goes quiet in a pocket.