xlaw 0.0.2

PCM-aLaw and PCM-MuLaw codecs.
Documentation
  • Coverage
  • 0%
    0 out of 16 items documented0 out of 13 items with examples
  • Size
  • Source code size: 32.45 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 686.53 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • 0xAA55-rs/rustwav
    8 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 0xAA55

XLaw - aLaw and μLaw PCM codecs

PCM-aLaw and PCM-MuLaw codecs.

Overview

The usage is very simple.

let alaw_encoder = PcmXLawEncoder::new_alaw();

let samples = vec![1i16, 30000i16, 500i16, -30000i16];
let mut encoded = Vec::<u8>::new();

for sample in samples {
	encoded.push(alaw_encoder.encode(*sample));
}

There are also PcmXLawDecoder, new_alaw(), and new_ulaw() to create them, and the encode() and decode() functions are just as easy as you want.

Simply, they do encode i16 samples into u8 codes, and decode u8 codes into i16 samples.

Personally, I'd prefer not to use these encoders. Just convert the WAV s16le PCM to the u8 PCM. My supreme sound card can handle u8 playback, its DSP functions can restore the u8 sound just like you are hearing the i16 format sample audio.