pub struct TsacCodec { /* private fields */ }Implementations§
Source§impl TsacCodec
impl TsacCodec
pub fn open(install_dir: impl AsRef<Path>) -> Result<TsacCodec, Error>
pub fn open_native( install_dir: impl AsRef<Path>, options: TsacOptions, ) -> Result<TsacCodec, Error>
pub fn open_bellard( install_dir: impl AsRef<Path>, options: TsacOptions, ) -> Result<TsacCodec, Error>
pub fn open_with_options( install_dir: impl AsRef<Path>, options: TsacOptions, ) -> Result<TsacCodec, Error>
pub fn with_options(self, options: TsacOptions) -> TsacCodec
pub fn install_dir(&self) -> &Path
pub fn options(&self) -> &TsacOptions
pub fn device(&self) -> Device
pub fn encode( &self, in_audio: impl AsRef<Path>, out_tsac: impl AsRef<Path>, ) -> Result<EncodeStats, Error>
pub fn decode( &self, in_tsac: impl AsRef<Path>, out_wav: impl AsRef<Path>, ) -> Result<(), Error>
pub fn roundtrip( &self, in_audio: impl AsRef<Path>, out_wav: impl AsRef<Path>, ) -> Result<RoundtripStats, Error>
Trait Implementations§
Source§impl FileCodec for TsacCodec
Unified rlx_core::FileCodec view of TSAC (file-bitstream compressor).
TSAC has no RVQ codes, so it implements FileCodec rather than the
frame/quantizer rlx_core::AudioCodec trait used by mimi/dac.
impl FileCodec for TsacCodec
Unified rlx_core::FileCodec view of TSAC (file-bitstream compressor).
TSAC has no RVQ codes, so it implements FileCodec rather than the
frame/quantizer rlx_core::AudioCodec trait used by mimi/dac.
Source§fn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Native sample rate the codec targets.
Source§fn encode_file(
&self,
in_audio: &Path,
out_compressed: &Path,
) -> Result<CompressStats, Error>
fn encode_file( &self, in_audio: &Path, out_compressed: &Path, ) -> Result<CompressStats, Error>
Compress
in_audio → out_compressed, returning size + timing.Source§fn decode_file(&self, in_compressed: &Path, out_wav: &Path) -> Result<(), Error>
fn decode_file(&self, in_compressed: &Path, out_wav: &Path) -> Result<(), Error>
Decompress
in_compressed → out_wav.Source§fn roundtrip_file(
&self,
in_audio: &Path,
out_wav: &Path,
) -> Result<CompressStats, Error>
fn roundtrip_file( &self, in_audio: &Path, out_wav: &Path, ) -> Result<CompressStats, Error>
Encode then decode through a temporary compressed file. Codecs with a
cheaper native roundtrip may override this.
Auto Trait Implementations§
impl !Freeze for TsacCodec
impl !RefUnwindSafe for TsacCodec
impl !Sync for TsacCodec
impl !UnwindSafe for TsacCodec
impl Send for TsacCodec
impl Unpin for TsacCodec
impl UnsafeUnpin for TsacCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more