Remove Metadata
Overview
Section titled “Overview”Remove Metadata is a high-performance CLI tool written in Rust that strips all non-essential metadata from WAV files in a directory. When preparing audio assets for distribution — whether for a game engine, streaming platform, or production pipeline — stray RIFF chunks like LIST, bext, iXML, or software tags can cause compatibility issues or leak unwanted information. This tool walks a directory tree, parses each WAV at the byte level, and rewrites it keeping only the fmt and data chunks.
It ships as both a native binary and an npm package (via NAPI-RS), so it integrates into Node.js-based audio build pipelines just as easily as it runs standalone from the terminal.
How It Works
Section titled “How It Works”The core logic parses the RIFF/WAVE container manually, iterating over chunks and retaining only what matters for playback:
while pos + 8 <= data.len() { let chunk_id = &data[pos..pos + 4]; let chunk_size = u32::from_le_bytes(/* ... */); // ... if chunk_id == b"fmt " || chunk_id == b"data" { // Keep this chunk new_data.extend_from_slice(chunk_id); new_data.extend_from_slice(&chunk_size.to_le_bytes()); new_data.extend_from_slice(chunk_data); } // Else skip — this is metadata}Files are only rewritten when their content actually changes, avoiding unnecessary disk I/O.
Features
Section titled “Features”- Parallel directory walking — Uses Rayon with
par_bridge()to discover and process WAV files across all CPU cores simultaneously - Byte-level RIFF parsing — Manually parses the RIFF container, keeping only
fmt(format) anddata(audio) chunks — no third-party audio libraries needed - In-place rewriting — Overwrites files only when metadata was actually removed, preserving audio data bit-for-bit
- Recursive traversal — Uses WalkDir to find
.wavfiles in nested subdirectories - Cross-platform npm package — Pre-built native binaries for macOS (ARM64) and Windows (x64) via NAPI-RS, usable as a CLI or as a Node.js function
- macOS code signing — CI pipeline automatically codesigns the macOS binary with Apple Developer ID for Gatekeeper compatibility
- Release-optimized builds — Compiled with LTO and symbol stripping for minimal binary size
As a CLI (after npm install -g remove-metadata):
remove-metadata ./path/to/wav-filesOr from Node.js / a build script:
import { run } from "remove-metadata";run("./assets/audio");Tech Stack
Section titled “Tech Stack”| Language | Rust |
| Node.js binding | NAPI-RS |
| Parallelism | Rayon |
| Directory traversal | WalkDir |
| CI/CD | GitHub Actions (build, codesign, npm publish) |
| Platforms | macOS ARM64, Windows x64 |
| Package manager | npm / Yarn |
Source Code
Section titled “Source Code”The source code is available on the project’s GitHub repository.