Much of this sample is an adaptation of the webrtc insertable streams one: https://webrtc.github.io/samples/src/content/peerconnection/endtoend-encryption/
js/opus.js is a partial port of libopus. It is barely enough to decode some silk bits but useful enough to generate some statistics for visualization contained in this post: https://webrtchacks.com/red-improving-audio-quality-with-redundancy/