Coder Social home page Coder Social logo

ncw's Introduction

Native Instruments NCW Audio File Format

crates.io docs.rs

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, a library for Native Instruments file formats support in rust.

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 ncw = NcwReader::read(&input)?;

println!("channels: {}", ncw.header.channels);
println!("sample_rate: {}", ncw.header.sample_rate);
println!("bits_per_sample: {}", ncw.header.bits_per_sample);

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.

ncw's People

Contributors

monomadic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.