pub struct NeuCodecEncoder;Expand description
NeuCodec encoder: converts a 16 kHz audio waveform to speech token IDs.
Note: The full NeuCodec encoder requires Wav2Vec2BertModel (~600 MB) as a semantic feature extractor. Encoder support is not yet implemented in this pure-Rust build.
For reference audio encoding, use the Python neucodec package:
from neucodec import NeuCodec
model = NeuCodec.from_pretrained("neuphonic/neucodec")
codes = model.encode_code(waveform) # → i32 arrayThen save the codes as a .npy file and pass via --ref-codes to the
synthesis examples.
Implementations§
Source§impl NeuCodecEncoder
impl NeuCodecEncoder
Sourcepub fn new() -> Result<NeuCodecEncoder, Error>
pub fn new() -> Result<NeuCodecEncoder, Error>
Always returns an error — encoder not yet implemented.
Sourcepub fn load(_path: &Path) -> Result<NeuCodecEncoder, Error>
pub fn load(_path: &Path) -> Result<NeuCodecEncoder, Error>
Always returns an error — encoder not yet implemented.
Sourcepub fn encode_wav(&self, _path: &Path) -> Result<Vec<i32>, Error>
pub fn encode_wav(&self, _path: &Path) -> Result<Vec<i32>, Error>
Encode a WAV file to speech token IDs (not implemented).
Sourcepub fn backend_name(&self) -> &str
pub fn backend_name(&self) -> &str
Backend name.
Auto Trait Implementations§
impl Freeze for NeuCodecEncoder
impl RefUnwindSafe for NeuCodecEncoder
impl Send for NeuCodecEncoder
impl Sync for NeuCodecEncoder
impl Unpin for NeuCodecEncoder
impl UnsafeUnpin for NeuCodecEncoder
impl UnwindSafe for NeuCodecEncoder
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
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