pub struct SnacDecoder { /* private fields */ }Expand description
SNAC neural codec decoder for Orpheus speech tokens.
Implementations§
Source§impl SnacDecoder
impl SnacDecoder
Sourcepub fn from_file(path: &Path) -> Result<SnacDecoder, Error>
pub fn from_file(path: &Path) -> Result<SnacDecoder, Error>
Load decoder weights + JSON config from path (.safetensors).
Sourcepub fn with_noise_seed(self, seed: u64) -> SnacDecoder
pub fn with_noise_seed(self, seed: u64) -> SnacDecoder
Override the PyTorch-style noise seed (torch.manual_seed before decode).
Sourcepub fn decode_codes(
&self,
codes_0: &[i32],
codes_1: &[i32],
codes_2: &[i32],
) -> Result<Vec<f32>, Error>
pub fn decode_codes( &self, codes_0: &[i32], codes_1: &[i32], codes_2: &[i32], ) -> Result<Vec<f32>, Error>
Decode three RVQ codebook streams to mono PCM at SAMPLE_RATE.
Sourcepub fn decode_orpheus_frames(
&self,
frame_tokens: &[i32],
) -> Result<Vec<f32>, Error>
pub fn decode_orpheus_frames( &self, frame_tokens: &[i32], ) -> Result<Vec<f32>, Error>
Decode interleaved Orpheus frame tokens (7 per frame) via crate::tokens::pack_orpheus_codes.
pub fn config(&self) -> &SnacConfig
pub fn weights_path(&self) -> &Path
Auto Trait Implementations§
impl Freeze for SnacDecoder
impl RefUnwindSafe for SnacDecoder
impl Send for SnacDecoder
impl Sync for SnacDecoder
impl Unpin for SnacDecoder
impl UnsafeUnpin for SnacDecoder
impl UnwindSafe for SnacDecoder
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