media-codec-opus 0.7.0

An Opus decoder implementation based on libopus for media-codec
Documentation
#[cfg(feature = "decoder")]
pub mod decoder;
#[cfg(feature = "encoder")]
pub mod encoder;

use std::{borrow::Cow, ffi::CStr};

use media_codec_opus_sys as opus_sys;

pub(crate) fn opus_error_string(error: i32) -> Cow<'static, str> {
    unsafe { CStr::from_ptr(opus_sys::opus_strerror(error)).to_string_lossy() }
}

#[repr(i32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Application {
    VoIP     = opus_sys::OPUS_APPLICATION_VOIP,
    Audio    = opus_sys::OPUS_APPLICATION_AUDIO,
    LowDelay = opus_sys::OPUS_APPLICATION_RESTRICTED_LOWDELAY,
}