cauldron

Crates.iocauldron
lib.rscauldron
version0.0.3
sourcesrc
created_at2019-11-26 21:42:16.67325
updated_at2020-07-19 13:24:54.456637
descriptionPure rust audio decoder for wav, flac, mp3 and aac
homepagehttps://github.com/deep110/cauldron
repositoryhttps://github.com/deep110/cauldron
max_upload_size
id184595
size174,888
Kevin Hu (kevinhu)

documentation

README

Cauldron

Build Status Crates.io docs.rs

A lightweight implementation of decoders for popular used audio formats [Flac, Wav, Mp3, Ogg, etc.] in pure Rust.

Features

Planned features are:

  • Decode and maybe Encode support for the most popular audio codecs
  • Providing a WASM API for web
  • Try supporting no_std environment

Codec Format Support Roadmap

Format Flag Read Write
AAC aac - -
Flac flac Done -
MP3 mp3 InProgress -
PCM pcm - -
WAV wav Done InProgress
Vorbis vorbis - -

Usage

Add this to Cargo.toml file:

[dependencies]
cauldron = "0.0.2"

Example code:

use cauldron::audio::AudioSegment;
use cauldron::codecs::FormatFlag;

let mut audio_segment = match AudioSegment::read("<path-to-audio-file>", FormatFlag::WAV) {
  Ok(f)  => f,
  Err(e) => panic!("Couldn't open example file: {}", e)
};

// display some audio info
println!("{}", audio_segment);


let samples: Vec<i32> = audio_segment.samples().unwrap().map(|r| r.unwrap()).collect();
println!("total samples {}", samples.len());

An example to play an audio can be found in examples/play.rs. To play any audio just run:

cargo run --example play <path-to-audio-file>

Acknowledgements

Contributing

Right now project is still in very early stages, so I am not looking for any contributions, but if you see any bug or improvement in existing implementation feel free to open an issue.

Commit count: 0

cargo fmt