GitXplorerGitXplorer
d

opusenc-rs

public
1 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
09e0a6441844363daa470906db1140df6f670790

chore: Release

dd-k-bo committed a year ago
Unverified
6f95eb9b041ccd10bb38bedb7a1c45d8ea26673d

Move release.toml into Cargo.toml

dd-k-bo committed a year ago
Unverified
f7bd0e805921cd8b4465714439e30ce99cb7f06f

Add changelog

dd-k-bo committed a year ago
Unverified
0594b37c02dddf27a466821b2a2bdce88012033d

Add opusenc-sys README

dd-k-bo committed a year ago
Unverified
da58669a28748cc8bf20d8d5df4aa6de1ba0fdfc

Fix clippy warnings

dd-k-bo committed a year ago
Unverified
79eb2a1a7f1d6d28492bb48cc0bc35e72d2a7f5a

Fix docs for `ope_encoder_get_option`/`ope_encoder_set_option`

dd-k-bo committed a year ago

README

The README file for this repository.

opusenc-rs

Build Status Crates.io Documentation License: BSD-3-Clause

High-level bindings for libopusenc.

Example

let audio_data: Vec<i16> = {
    let mut file = std::fs::File::open("/dev/urandom")?;
    let mut buf = vec![0; 60 * 48_000 * 2 * 2];
    file.read_exact(&mut buf)?;
    buf.chunks_exact(2)
        .map(|a| i16::from_ne_bytes([a[0], a[1]]))
        .collect()
};

let mut encoder = Encoder::create_file(
    "/tmp/noise.opus",
    Comments::create()
        .add(RecommendedTag::Title, "Random Noise")?
        .add(RecommendedTag::Artist, "/dev/urandom")?,
    48_000,
    2,
    MappingFamily::MonoStereo,
)?;

encoder.write(&audio_data)?;
encoder.drain()?;

Encoder options

This crate provides a encoder-options feature which enables reading and changing encoder options.

Warning: Some of these options might not work with opusenc, may be unsafe or even cause UB. They are intended to be used via C macros that don't work with Rust. Make sure to check if the methods you use match their intended behaviour.

License

This project is licensed under the BSD-3-Clause License.

See COPYING for more information.