pub struct Encoder { /* private fields */ }Expand description
The Higgs audio tokenizer v2’s encoding half, for a reference voice:
HuBERT features (every second frame) through the semantic encoder, the
DAC encoder over the 24 kHz samples, fc, and the residual codebooks.
Implementations§
Source§impl Encoder
impl Encoder
pub fn from_model( model: &Arc<CmfModel>, cfg: &OmniVoiceConfig, pool: Option<Arc<Pool>>, ) -> Result<Self, String>
Sourcepub fn encode(&self, wav: &[f32]) -> Result<Vec<Vec<u32>>, String>
pub fn encode(&self, wav: &[f32]) -> Result<Vec<Vec<u32>>, String>
HiggsAudioV2TokenizerModel.encode: 24 kHz samples → [books][frames].
Sourcepub fn voice_prompt(
&self,
wav24: &[f32],
ref_text: &str,
) -> Result<VoicePrompt, String>
pub fn voice_prompt( &self, wav24: &[f32], ref_text: &str, ) -> Result<VoicePrompt, String>
create_voice_clone_prompt with a transcript: loudness lifted to an
RMS of 0.1 when quieter, silences trimmed, cut to whole frames, encoded.
Auto Trait Implementations§
impl !RefUnwindSafe for Encoder
impl !UnwindSafe for Encoder
impl Forget for Encoder
impl Freeze for Encoder
impl Move for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
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