1
1
Fork
You've already forked claxon
1
A FLAC decoder in Rust https://github.com/ruuda/claxon
  • Rust 94%
  • Shell 5%
  • R 1%
Find a file
Ruud van Asseldonk 5fcd0c1cf6 Ban the use of LLMs in the issue tracker
I already had a line in place to discourage LLM-generated *code*, but
recently I see things popping up where accounts are posting what looks
like LLM-generated messages in pull requests and issue trackers.
I saw a comment pop up now, I seriously wonder, was this a human who
copy-pasted ChatGPT output, or do people give Claude Code access to 'gh'
with a valid token, and do they let agents autonomously post comments
upstream on their behalf?
Whatever it was, it's a waste of everybody's time, and I want nothing to
do with this in my repositories.
2025年12月03日 20:03:58 +01:00
benches Fix Cargo benchmarks 2017年02月07日 12:37:20 +01:00
docs Describe what Claxon is in the readme 2017年09月09日 11:26:16 +02:00
examples Improve compatibility and prints in decode_simple 2022年10月08日 14:17:57 +02:00
fuzz Bump version to 0.4.3 2020年08月09日 12:05:40 +02:00
src Derive Eq for the two structs too 2021年12月29日 22:49:01 +01:00
tests Add test for empty Vorbis comment 2019年09月11日 22:19:10 +02:00
testsamples Fix integer underflow when reading Vorbis comments 2019年09月16日 20:26:42 +02:00
tools Try fuzzing on Travis once more 2019年05月19日 19:37:52 +02:00
.gitignore Put Cargo.lock under source control 2017年09月03日 12:09:28 +02:00
.travis.yml Try fuzzing on Travis once more 2019年05月19日 19:37:52 +02:00
Cargo.lock Bump version to 0.4.3 2020年08月09日 12:05:40 +02:00
Cargo.toml Bump version to 0.4.3 2020年08月09日 12:05:40 +02:00
changelog.md Bump version to 0.4.3 2020年08月09日 12:05:40 +02:00
contributing.md Ban the use of LLMs in the issue tracker 2025年12月03日 20:03:58 +01:00
license change license to Apache 2.0 2016年05月29日 16:13:07 +02:00
readme.md Add new Claxon-vs-libflac benchmark results 2018年08月31日 16:29:33 +02:00

Claxon

A FLAC decoding library in Rust.

Build Status Crates.io version Changelog Documentation

Claxon is a FLAC decoder written in pure Rust. It has been fuzzed and verified against the reference decoder for correctness. Its performance is similar to the reference decoder.

Example

The following example computes the root mean square (RMS) of a FLAC file:

letmutreader=claxon::FlacReader::open("testsamples/pop.flac").unwrap();letmutsqr_sum=0.0;letmutcount=0;forsampleinreader.samples(){lets=sample.unwrap()asf64;sqr_sum+=s*s;count+=1;}println!("RMS is {}",(sqr_sum/countasf64).sqrt());

More examples can be found in the examples directory. For a simple example of decoding a FLAC file to wav with Claxon and Hound, see decode_simple.rs. A more efficient way of decoding requires dealing with a few details of the FLAC format. See decode.rs for an example.

Performance

These are the times to decode 5 real-world FLAC files to wav, average and standard deviation of 11 runs, normalized to version 1.3.2 of the reference implementation. Measurements were done on a Skylake i7. Claxon was compiled with Rust 1.26.0.

Decoder Time / reference
Claxon 1.10 ± 0.01
libflac 1.00 ± 0.01

Note that for decent performance, Claxon should be compiled with -C codegen-units=1 on Rust ≥ 1.24.0. Not passing this RUSTFLAG can cause as much as a 45% increase in running time.

Contributing

Contributions in the form of bug reports, feature requests, or pull requests are welcome. See contributing.md.

License

Claxon is licensed under the Apache 2.0 license. It may be used in free software as well as closed-source applications, both for commercial and non-commercial use under the conditions given in the license. If you want to use Claxon in your GPLv2-licensed software, you can add an exception to your copyright notice. Please do not open an issue if you disagree with the choice of license.