This examples illustrates the use of the BinauralPanner to spatialize in real-time a incoming monophonic audio streams around the head of the listener. In this implementation, the binaural process simply relies on the convolution of the incoming audio stream with Head Related Impulse Responses (HRIRs) measured on a human head in free field conditions (anechoïc room).
For implementation details and implementation alternative, see T. Carpentier, Binaural Synthesis with the Web Audio API, 1st Web Audio Conference (WAC15), Paris 2015 PDF
The API provides control on the positions of the sources and of the listener. It also proposes to download different sets of HRIRs, either from a server or from an URL. The public server that hosts a database of individual HRIRs is available for beta-testers only and will open to public in 2016.
Here are some examples: