The following repository is a Proof Of Concept to measure the latency in modern web browsers by using a MLS signal (a type of noise). The app will play and record the MLS noise using the Web Audio API and will compute the cross correlation to estimate the delay. A graph is also displayed showing the resulting peak of the cross correlation and the wave form of audio data recorded.
As a mechanism to validate if the test went well or not, the ratio operation is introduced to calculate the relation between the peak and the rest of the signal in terms of energy. After running some tests a threshold of 1.8 aprox has been set, which means all ratios above that value are linked to a nice latency estimation and below are probably wrong.
Requirement: Node.js v14
git clone https://github.com/gilpanal/weblatencytest.git
cd weblatencytest
npm i
npm run dev
- Navigate to
localhost:1234