Audiopus is a high level abstraction over the Opus library.
This crate uses its own implementation of
TryFrom attempting to
convert to newtypes (
MutSignals) ensuring Opus'
restrictions will be kept in mind by checking these on construction.
Without these restrictions, crashes would occur because Opus does not know
any types larger than
i32 and does not expect empty packets.
Hence our own
TryFrom allows us to couple restriction-checks
with actual types and yet remaining stable Rust.
MutSignals implement conversions from
&[T], they do not move or destroy the original type.
Packet references an underlying buffer of type
&[u8], it cannot be
empty and not longer than
Same goes for
MutPacket, except the type mutably borrows the buffer thus
checks length before handing out the length-value as
MutSignals wraps around a generic buffer and represents Opus' output.
E.g. when encoding, Opus will fill the buffer with the encoded data.
Audiopus aims to never panic or crash when interacting with Opus, if either occurs, consider this a bug.
A newtype wrapping around a mutable buffer. They represent mutably borrowed arguments that will be filled by Opus. E.g. you pass this to an encode-method and Opus encodes data into the underlying buffer.
Represents possible application-types for Opus.
Represents possible bandwidths of an Opus-stream.
Represents possible audio channels Opus can use.
Represents possible sample rates Opus can use. Values represent Hertz.