ALAC Encoder for Rust
Rust port of Apple's open source ALAC library.
Installation
This crate works with Cargo and is on crates.io.
Usage
use ;
// Specify the input format as signed 16-bit raw PCM, 44100 Hz & 2 channels
let input_format = ;
// Specify the output format as 44100 Hz ALAC with a frame size of 4096 & 2 channels
let output_format = alac;
// Initialize the encoder
let mut encoder = new;
// Allocate a buffer for the encoder to write chunks to.
// The smallest size of one chunk is (frame size * channels * bit depth in bytes) + max escape header bytes.
let mut output = vec!;
// Get a hold of the source data, e.g. from a file
let pcm = read.unwrap;
// Iterate over chunks from the input
for chunk in pcm.chunks
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.