<?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: Phantas</title>
    <description>The latest articles on DEV Community by Phantas (@phantas_ea0b1015fd6ebeb52).</description>
    <link>https://dev.to/phantas_ea0b1015fd6ebeb52</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3683208%2F092c796e-8e79-4377-83da-b376fb4f9c0d.png</url>
      <title>DEV Community: Phantas</title>
      <link>https://dev.to/phantas_ea0b1015fd6ebeb52</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/phantas_ea0b1015fd6ebeb52"/>
    <language>en</language>
    <item>
      <title>How I built a browser-based "Binaural Strobe" using the Web Audio API (React + Next.js)</title>
      <dc:creator>Phantas</dc:creator>
      <pubDate>Sun, 28 Dec 2025 21:21:09 +0000</pubDate>
      <link>https://dev.to/phantas_ea0b1015fd6ebeb52/how-i-built-a-browser-based-binaural-strobe-using-the-web-audio-api-react-nextjs-8kg</link>
      <guid>https://dev.to/phantas_ea0b1015fd6ebeb52/how-i-built-a-browser-based-binaural-strobe-using-the-web-audio-api-react-nextjs-8kg</guid>
      <description>&lt;p&gt;The Problem: I have Aphantasia (no mental imagery). I struggle to get into "Deep Work." I tried binaural beats on Spotify, but audio compression (MP3/AAC) ruins the phase difference needed for the science to work.&lt;/p&gt;

&lt;p&gt;The Solution I decided to build a raw audio/visual synth in the browser to mechanically force focus.&lt;/p&gt;

&lt;p&gt;The Tech Stack&lt;/p&gt;

&lt;p&gt;Framework: Next.js (React)&lt;/p&gt;

&lt;p&gt;Audio: Native AudioContext API (for real-time oscillators).&lt;/p&gt;

&lt;p&gt;Visuals: requestAnimationFrame to sync a 490nm Cyan strobe.&lt;/p&gt;

&lt;p&gt;The Tricky Part (Code Snippet) The hardest part was handling the "Drift." Javascript timers are imprecise. I had to use the audio context's internal clock currentTime to schedule the oscillator frequency ramps so they wouldn't desync from the strobe.&lt;/p&gt;

&lt;p&gt;The Result It's called &lt;a href="https://dev.tourl"&gt;Phantas.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It generates everything locally on your CPU. No login required to use the generator.&lt;/p&gt;

&lt;p&gt;Question for Devs: I'm currently using a simple setInterval for the React state updates on the visual timer, but I'm thinking of moving the whole timing engine to a Web Worker to prevent UI blocking. Has anyone tried this for high-precision metronomes?&lt;/p&gt;

&lt;h1&gt;
  
  
  react #javascript #webdev #showdev
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>showdev</category>
      <category>nextjs</category>
      <category>api</category>
    </item>
  </channel>
</rss>
