Skip to content

Remove Metadata

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.

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.

  • 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) and data (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 .wav files 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):

Terminal window
remove-metadata ./path/to/wav-files

Or from Node.js / a build script:

import { run } from "remove-metadata";
run("./assets/audio");
LanguageRust
Node.js bindingNAPI-RS
ParallelismRayon
Directory traversalWalkDir
CI/CDGitHub Actions (build, codesign, npm publish)
PlatformsmacOS ARM64, Windows x64
Package managernpm / Yarn

The source code is available on the project’s GitHub repository.