MediaStreamTrackProcessor/MediaStreamTrackGenerator Latency Demo

This is a demo of using MediaStreamTrackProcessor (MSTP)/MediaStreamTrackGenerator (MSTG) to process an audio MediaStream that is to be sent between two PeerConnections to be rendered at the other end.

ConstantSource -> AW1 (add signature) -> MediaStreamDestination -> MSTP -> Processing -> MSTG --+-> PC1 -> PC2 -> MediaStreamSource -> AW2

Processing occurs on the main thread. If the browser does not support MediaStreamTrackProcessor for audio on the main thread, Jan-Ivar's MediaStreamTrackProcesor polyfill is used instead.

ShimMediaStreamTrackGenerator is Jan-Ivar's MediaStreamTrackGenerator polyfill renamed so that it can be used alongside the native MediaStreamTrackGenerator.

This demo is based on this other demo by Stefan.