How hoba3d/hoba-runtime works
Project type and purpose
• This is a client-side JavaScript framework (HOBA renderer) for personalized binaural-audio rendering in web browsers. It provides a runtime library plus demo pages that show how to load head-related transfer functions (HRTFs) on demand, apply spatial panning, and output binaural audio via the Web Audio API.
File structure
• Top-level:
• LICENSE, README.md
• demos/ — static demo pages (HTML/CSS) and sample audio/HRTF data
• libs/ — third-party utilities (TrackballControls.js, osc2ws.js)
• renderer/ — core HOBA modules (hoba.js plus per-feature files)
• Patterns:
• “renderer/” contains modular components: listener, OSC interface, spatial panner, audio adapter (waa), HRTF loader (wavh), spatial source.
• “demos/” shows integration points: UI, WebGL controls, OSC-over-WebSocket, HTML/CSS styling, data assets.
README
• Confirms it’s the runtime portion of the HOBA framework.
• Purpose: personalized HRTF selection based on anthropometry.
• Target: web browsers, leveraging Web Audio API.
Elements
• Labels: “UI / Demo Pages,” “HOBA Core,” “Web Audio API,” “HRTF Data Store,” “OSC Server”
• UI → HOBA API calls
• HOBA modules → AudioContext nodes
• hoba-wavh → HRTF data files
• osc2ws → hoba-osc → hoba.js
• Blue for UI/Browser components
• Green for HOBA modules
• Orange for Web Audio API nodes
• Gray for external data/services
Final advice
• How data and control flow from the user or OSC server all the way to the audio output.
• Every essential interaction, but avoid clutter by aggregating low-level Web Audio nodes under one “AudioContext” wrapper if needed.