atrac3p-decoder

Crates.ioatrac3p-decoder
lib.rsatrac3p-decoder
version0.1.2
sourcesrc
created_at2020-04-10 16:40:08.790912
updated_at2020-04-21 20:03:19.157689
descriptionAtrac3+ Decoder in Rust. Can be used as a source for Rodio.
homepage
repositoryhttps://github.com/tarkah/atrac3p-decoder
max_upload_size
id228391
size266,893
Cory Forsstrom (tarkah)

documentation

https://docs.rs/atrac3p-decoder

README

Atrac3+ Decoder

Crates.io

Atrac3+ Decoder in Rust. Can be used as a source for Rodio. Currently only supports the .at3 / .wav RIFF WAV container format.

Rodio Source

Decoder implies rodio's Source trait, as well as Iterator.

Example with Rodio

use anyhow::Error;

use std::fs::File;
use std::io::BufReader;

fn main() -> Result<(), Error> {
    let file = File::open("path/to/song.at3")?;
    let reader = BufReader::new(file);

    let decoder = atrac3p_decoder::Decoder::new(reader)?;

    let device = rodio::default_output_device().unwrap();
    let sink = rodio::Sink::new(&device);

    sink.append(decoder);
    sink.play();
    sink.sleep_until_end();

    Ok(())
}
Commit count: 14

cargo fmt