Crates.io | flacenc-bin |
lib.rs | flacenc-bin |
version | 0.2.4 |
source | src |
created_at | 2023-09-20 07:56:20.433402 |
updated_at | 2024-03-05 10:03:43.253756 |
description | FLAC encoder written in pure Rust. An example application for flacenc crate. |
homepage | |
repository | https://github.com/yotarok/flacenc-rs/ |
max_upload_size | |
id | 977894 |
size | 56,867 |
A CLI tool for encoding wav files into flac format, which compresses the input waveform by ~60% without any degradation. This is an example application of flacenc library.
To install (with using nightly rust; recommended):
cargo +nightly install flacenc-bin --features "simd-nightly"
Or, if you want to use stable channel:
cargo install flacenc-bin
Then, you can run encoding as follows:
flacenc --output output.flac input.wav
If you want to customize the encoder behavior, you can specify an additional config file. To do so, first, you may generate the default config file by:
flacenc --output output.flac --dump-config config.toml input.wav
Then, edit config.toml
and encode with the customized config, as:
flacenc --output output.flac --config config.toml input.wav
This binary crate has a few feature flags to enable additional features:
pprof
: If activated, the binary accept an additional command line argument
--pprof-output [FILE]
. If this flag is set, profiling data that can be
processed by pprof
are collected during the encoding process.simd-nightly
: If activated, the dependency library is built with
simd-nightly
feature. This is a recommended setting; however, it is only
available in a nightly toolchain.See CONTRIBUTING.md
for details.
Apache 2.0; see LICENSE
for details.
This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.
This encoder is still unstable and sometimes the encoded file may contain distortion, i.e. the encoder very rarely outputs broken signals. You can check whether you encountered an encoder bug by running, e.g., the reference decoder. The FLAC format contains MD5 digest of the input signal, and the reference decoder checks if the digest of the decoded signal matches with the stored one.