GitXplorerGitXplorer
d

opusenc-rs

public
1 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
685ae99e3cb7ec19f330b78877d5d715e79a14de

chore: Release

dd-k-bo committed 3 months ago
Verified
c36abce1003eb7fa119ce12c13b75bf92727d700

Add pull/get_page API (#3)

SSaafo committed 3 months ago
Unverified
1a8dfe1a62afe70536fd2da6ca708fb985d25132

chore: Release

dd-k-bo committed a year ago
Unverified
2677b425eac44f5827dd74d6fc85f0e4ae591df6

Fix invalid changelog configuration

dd-k-bo committed a year ago
Unverified
72bf4fb256f197e24e16390ebd5310f43754237a

Update changelog

dd-k-bo committed a year ago
Unverified
a78b4bcc6fa07a0af9cd28eb17044e3bf9e1906c

chore: Release

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.