Crates.io | cauldron |
lib.rs | cauldron |
version | 0.0.3 |
source | src |
created_at | 2019-11-26 21:42:16.67325 |
updated_at | 2020-07-19 13:24:54.456637 |
description | Pure rust audio decoder for wav, flac, mp3 and aac |
homepage | https://github.com/deep110/cauldron |
repository | https://github.com/deep110/cauldron |
max_upload_size | |
id | 184595 |
size | 174,888 |
A lightweight implementation of decoders for popular used audio formats [Flac, Wav, Mp3, Ogg, etc.] in pure Rust.
Planned features are:
no_std
environmentFormat | Flag | Read | Write |
---|---|---|---|
AAC | aac |
- | - |
Flac | flac |
Done | - |
MP3 | mp3 |
InProgress | - |
PCM | pcm |
- | - |
WAV | wav |
Done | InProgress |
Vorbis | vorbis |
- | - |
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>
FFmpeg for some algorithm clarity and channel layout understanding
Claxon for code structure of Input streams
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.