Back to the example index

Shared AudioContext and routing

This page is the host: clicking Start creates an AudioContext. OPM borrows it, with destination: null disabling automatic routing; audio must pass through the host's GainNode to reach the speakers.

Host volume 30%

Start, connect, then hold a note. Disconnecting changes routing, not the note; reconnect to hear it again. Releasing a note leaves its release tail; disposing OPM removes its node. Restarting reuses the host context and GainNode.

Host context: Not created

Routing: Disconnected

Note: No held note

Diagnostics: Available while connected and the host is running.

Click Start to begin; this page never autoplays.

OPM's close() never closes or suspends a borrowed context. The host closes it only when this page is left.