<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: pk yt</title>
    <description>The latest articles on DEV Community by pk yt (@pk_yt_64515911eb8502cbf38).</description>
    <link>https://dev.to/pk_yt_64515911eb8502cbf38</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4201085%2F4c9e2529-a0c2-455b-81f4-dcdee967a81b.png</url>
      <title>DEV Community: pk yt</title>
      <link>https://dev.to/pk_yt_64515911eb8502cbf38</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pk_yt_64515911eb8502cbf38"/>
    <language>en</language>
    <item>
      <title>How a browser microphone test works (getUserMedia and AnalyserNode)</title>
      <dc:creator>pk yt</dc:creator>
      <pubDate>Thu, 22 Oct 2026 18:48:28 +0000</pubDate>
      <link>https://dev.to/pk_yt_64515911eb8502cbf38/how-a-browser-microphone-test-works-getusermedia-and-analysernode-5cbj</link>
      <guid>https://dev.to/pk_yt_64515911eb8502cbf38/how-a-browser-microphone-test-works-getusermedia-and-analysernode-5cbj</guid>
      <description>&lt;p&gt;A mic test page looks simple: you talk and a bar moves. Underneath it is only three browser APIs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;navigator.mediaDevices.getUserMedia({ audio: true }) asks the user for permission and returns a MediaStream. This only works on HTTPS, and the user must allow it.&lt;/li&gt;
&lt;li&gt;An AudioContext turns the stream into a source node (createMediaStreamSource).&lt;/li&gt;
&lt;li&gt;An AnalyserNode reads the signal. getByteTimeDomainData gives you the waveform, getByteFrequencyData gives you the spectrum. You call it on every animation frame and draw the values on a canvas.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a level meter, take the root mean square of the time-domain samples. It follows loudness better than the peak does, and it jumps around less.&lt;/p&gt;

&lt;p&gt;Two things surprised me while building mine (&lt;a href="https://www.prodevicetest.com/mic-test/" rel="noopener noreferrer"&gt;https://www.prodevicetest.com/mic-test/&lt;/a&gt;). First, browsers can apply echo cancellation, noise suppression and auto gain by default, so a test can look better than the raw mic. Turning these off with constraints (echoCancellation: false, and so on) shows what the hardware really does. Second, on mobile the permission prompt appears every time unless the user selects ""remember"", so the page needs to explain what will happen before it asks.&lt;/p&gt;

&lt;p&gt;The full set of tests (screen, keyboard, printer and more) is at &lt;a href="https://www.prodevicetest.com/" rel="noopener noreferrer"&gt;https://www.prodevicetest.com/&lt;/a&gt;."&lt;/p&gt;

</description>
      <category>api</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
