1 pointby AphantaZach16 days ago2 comments
  • AphantaZach16 days ago
    OP here. I built this engine because I realized auditory entrainment (for focus and my own Aphantasia) is often compromised by standard streaming platforms.

    Most codecs (MP3/AAC) use "Joint Stereo" (Mid/Side coding) to save bandwidth. Since binaural beats rely entirely on the subtle phase difference between Left/ Right channels, compression algorithms tend to treat that data as redundant and smooth it over.

    I didn't want to leave it to chance, so I moved the stack to the Web Audio API. It generates the sine waves in real-time (client-side), ensuring mathematical precision and perfect channel isolation.

    Happy to answer questions about the physics or implementation.

  • LarsAlereon16 days ago
    Based on my experience and some brief research I don't think this is generally accurate. While I'm sure some combinations of encoder and bitrate might be an issue, YouTube is actually delivering rather high quality audio on HD videos. There's nothing inherent to Joint Stereo encoding that would make binaural audio not work, it's the default choices encoders make at low bitrates.
    • AphantaZach16 days ago
      Modern encoders (especially Opus) are indeed impressive at preserving the stereo image at high quality settings. If you are on a stable connection getting the full 192kbps+ stream, the phase error is likely negligible.

      The issue is that we can't control the delivery.

      Streaming platforms use adaptive bitrate. If a user's bandwidth dips on mobile, the player might switch to a lower tier where the model starts aggressively quantizing the Side channel (L-R) to save space.

      Since the binaural effect relies entirely on that Side channel difference, I wanted to remove the variable entirely.

      By generating it client-side with the Web Audio API, we get mathematical certainty regardless of the user's connection speed.

      • LarsAlereon15 days ago
        I think if you pitched this as "binaural beats that always work regarding of network conditions" that would be better-received. I don't think there's much of a scenario where streaming services aren't able to consistently deliver high enough quality for 3D positional audio. If there were, ASMR artists would be pushing much harder for alternate platforms.
        • AphantaZach15 days ago
          You make a great point. 'Determinism > Bandwidth' is definitely the stronger argument.

          The main difference with ASMR is that it uses multiple spatial cues (reverb, tone) which survive compression well.

          Entrainment is more fragile. For a cognitive tool, I wanted to engineer that risk out of the system entirely.