Skip to content
/ HERTZ Public

Professional audio polishing in the browser. Zero servers. 100% Private. Built with FFmpeg.wasm.

Notifications You must be signed in to change notification settings

askpext/HERTZ

Repository files navigation

HERTZ

High-fidelity client-side audio processing engine.

HERTZ is a web-based Digital Audio Workstation (DAW) utility designed for instant vocal polishing. It leverages the Web Audio API for real-time signal processing and FFmpeg.wasm for client-side encoding. Unlike traditional tools that rely on server-side processing (FFmpeg binaries on Linux), HERTZ runs entirely within the user's browser thread via WebAssembly.


image

Core Architecture

The application is built on a "Zero-Server" architecture. The goal is to eliminate the latency, bandwidth costs, and privacy risks associated with uploading sensitive audio data to cloud storage.

The Pipeline

  1. Ingestion: Decodes varied input formats (WAV, MP3, M4A, OGG) into a raw 32-bit floating-point AudioBuffer.
  2. Manipulation: Provides a non-destructive editing layer using Wavesurfer.js regions, allowing users to define sample-accurate start/end points.
  3. Digital Signal Processing (DSP):
    • Constructs an OfflineAudioContext for faster-than-realtime rendering.
    • Routes audio through a hardcoded vocal chain (EQ -> Compressor -> Limiter).
    • Analysis pass determines peak amplitude for accurate normalization.
  4. Encoding:
    • Transfers processed buffer to the ffmpeg.wasm virtual file system.
    • Executes LAME MP3 encoding at 192kbps VBR.
    • Streams the resulting Blob directly to the user's download manager.

Signal Chain Specification

HERTZ does not use generic presets. The audio engine implements a specific vocal chain optimized for spoken word and podcast clarity.

1. High-Pass Filter

  • Cutoff: 80Hz
  • Q: 1.4
  • Purpose: Removes sub-bass rumble and DC offset artifacts often present in consumer microphones.

2. Dynamics Compressor

A hard-knee compressor designed to level vocal dynamic range without introducing pumping artifacts.

  • Threshold: -20.0 dB
  • Ratio: 3.1:1
  • Knee: 5.0 dB
  • Attack: 0.03s (30ms)
  • Release: 0.1s (100ms)

3. Normalization

Post-compression gain staging ensures compliance with broadcast loudness standards.

  • Target: -3.0 dB Peak
  • Method: Linear gain calculation based on absolute max amplitude scanning.

Technical Constraints & Browser Security

HERTZ relies on SharedArrayBuffer to facilitate multi-threaded processing in FFmpeg.wasm. Modern browsers restrict this feature behind strict security headers to prevent Spectre/Meltdown vulnerabilities.

To run HERTZ locally or in production, the host must serve the following headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

If these headers are missing, ffmpeg.wasm will fail to initialize, and the application will throw a buffer allocation error. The included vite.config.ts handles this for local development.


Installation & Development

Requirements

  • Node.js 18.x or higher
  • NPM or Bun package manager
  • A modern browser with WebAssembly support (Chrome 90+, Firefox 90+, Safari 15+)

Setup

# Clone the repository
git clone [https://github.com/askpext/hertz.git](https://github.com/askpext/hertz.git)

# Enter directory
cd hertz

# Install dependencies
npm install

Running Locally

npm run dev

The application will launch at http://localhost:5173.

Building for Production

npm run build

This generates a static asset bundle in /dist. Note that you cannot simply open index.html locally; it must be served via a web server that supports the required COOP/COEP headers (e.g., Vercel, Netlify, or GitHub Pages).


About

Professional audio polishing in the browser. Zero servers. 100% Private. Built with FFmpeg.wasm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors