ncw 0.1.2

Native Instruments NCW audio file format support
Documentation
  • Coverage
  • 0%
    0 out of 11 items documented0 out of 0 items with examples
  • Size
  • Source code size: 4.63 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • monomadic/ncw
    27 3 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • monomadic

Native Instruments NCW Audio File Format

Description

NCW (Native Instruments Compressed Wave) is a lossless compression algorithm developed by Native Instruments which is essentially DPCM and bit truncation.

This library is a zero-dependency Rust-based library to decode NCW files. It serves as part of a wider reverse engineering effort of proprietary audio formats, and this particular library is used in ni-file.

This repository also includes an ncw to wav conversion cli tool, ncw-decode.

Requirements

  • Rust 1.50 or higher

Usage

let input = File::open(&args[1])?;
let mut output = File::create(&args[2])?;
let mut ncw = NcwReader::read(&input)?;

let spec = WavSpec {
		channels: ncw.header.channels,
		sample_rate: ncw.header.sample_rate,
		bits_per_sample: ncw.header.bits_per_sample,
		sample_format: hound::SampleFormat::Int,
};

for sample in ncw.decode_samples()? {
	// save or convert each sample into a file or stream
	dbg!(sample);
}

Utility (ncw-convert)

To install the cli utility, you can use cargo:

cargo install ncw-convert

Usage

Run the program with the following command-line arguments:

ncw-convert <INPUT> <OUTPUT>
  • <INPUT>: Path to the input NCW file.
  • <OUTPUT>: Path where the output WAV file will be saved.

Contribution

To contribute, create a pull request with your proposed changes.