#codec #heap-memory #encoding #no-alloc #a-law #u-law

no-std audio-codec-algorithms

Audio codec algorithms: A-law and μ-law

3 releases

0.5.6 Apr 7, 2024
0.5.5 Apr 2, 2024
0.5.2 Mar 31, 2024

#446 in Audio

Download history 113/week @ 2024-03-25 280/week @ 2024-04-01 42/week @ 2024-04-08 23/week @ 2024-04-15 26/week @ 2024-04-22 1/week @ 2024-04-29 7/week @ 2024-05-06 4/week @ 2024-05-13 14/week @ 2024-05-20 26/week @ 2024-05-27 26/week @ 2024-06-03 42/week @ 2024-06-10 34/week @ 2024-06-17 7/week @ 2024-06-24

110 downloads per month
Used in ausnd

MIT/Apache

17KB
210 lines

Audio Codec Algorithms

Cross-platform tests

Decoding and encoding for few basic audio codecs implemented in Rust:

Features:

  • supports no_std
  • no heap memory allocations
  • no unsafe code
  • no panicking
  • only dependencies for testing: no-panic and criterion

Running the example

Try out decoding and encoding values:

cargo run --example codec-tester decode ulaw 3 130 221
cargo run --example codec-tester encode alaw 10 -5430 3263

Running tests

Run:

# run the tests
cargo test
# ensure good code quality
cargo clippy
# ensure that the release build never panics
cargo test --release --features internal-no-panic

Performance testing:

cargo bench

There is a GitHub Action called "Cross-platform tests" (cross-test.yml), which automatically runs cargo test for little-endian 64-bit x64_86 and big-endian 32-bit PowerPC.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

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.

Dependencies

~115KB