GitXplorerGitXplorer
d

cdparanoia-rs

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
28b61432c6afac0c94c1fe404011d61434461c6d

Capture messages and integrate with `tracing`

dd-k-bo committed a year ago
Unverified
54bd5c191c3ecbc59f5b354605ac5f037df87efc

Let Paranoia take ownership of the Drive

dd-k-bo committed a year ago
Unverified
ac794b67f0efd11d9710451ad651ac7a8ebe8579

Initial commit

dd-k-bo committed 2 years ago

README

The README file for this repository.

cdparanoia-rs

High-level bindings for libcdio-paranoia/cdparanoia-3.

By default, this library uses libcdio-paranoia under the hood. If you want to use the original cdparanoia-3 library instead, you need to disable the default features and enable cdparanoia-3 instead.

cargo add cdparanoia --no-default-features --features cdparanoia-3

Example

The following example uses hound to write the first track of a CD in a default drive to /tmp/example.wav.

let drive = cdparanoia::Drive::find()?;
let mut paranoia = drive.paranoia();

let mut writer = hound::WavWriter::create(
    "/tmp/example.wav",
    hound::WavSpec {
        channels: paranoia.drive().track_channels(1).unwrap_or(2).into(),
        sample_rate: 44100,
        bits_per_sample: 16,
        sample_format: hound::SampleFormat::Int,
    },
)?;

for sector_result in paranoia.read_track(1)? {
    let sector = sector_result?;
    let mut writer = writer.get_i16_writer(sector.len() as u32);
    for sample in sector {
        writer.write_sample(sample);
    }
    writer.flush()?;
}

License

This project is licensed under GNU General Public License version 3 or later (GPL-3.0-or-later).