claxon 0.2.1

A FLAC decoding library

Crate claxon [] [src]

Claxon, a FLAC decoding library.

Examples

The following example computes the root mean square (RMS) of an audio file with at most 16 bits per sample.

use claxon;

let mut reader = claxon::FlacReader::open("testsamples/pop.flac").unwrap();
let mut sqr_sum = 0.0;
let mut count = 0;
for sample in reader.samples::<i16>() {
    let s = sample.unwrap() as f64;
    sqr_sum += s * s;
    count += 1;
}
println!("RMS is {}", (sqr_sum / count as f64).sqrt());

TODO: more examples.

Modules

frame

The frame module deals with the frames that make up a FLAC stream.

metadata

The metadata module deals with metadata at the beginning of a FLAC stream.

sample

The sample module provides the Sample trait and its implementations.

subframe

The subframe module deals with subframes that make up a frame of the FLAC stream.

Structs

FlacReader

A FLAC decoder that can decode the stream from the underlying reader.

FlacSamples

An iterator that yields samples of type S read from a FlacReader.

Enums

Error

An error that prevents succesful decoding of the FLAC stream.

Type Definitions

Result

A type for results generated by Claxon where the error type is hard-wired.