#[non_exhaustive]pub enum Model {
WaveNet(WaveNet),
Lstm(Lstm),
}Expand description
A runnable NAM model of any supported architecture.
Build with Model::from_nam; then call Model::process_buffer on the audio
thread. #[non_exhaustive] so future architectures don’t break downstream
matches.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl Model
impl Model
Sourcepub fn from_nam(model: &NamModel) -> Result<Self, Error>
pub fn from_nam(model: &NamModel) -> Result<Self, Error>
Build the runtime matching model.architecture. All allocation happens here.
Sourcepub fn process_buffer(&mut self, io: &mut [f32])
pub fn process_buffer(&mut self, io: &mut [f32])
Process a buffer of mono samples in place. Allocation-free.
Sourcepub fn process_sample(&mut self, x: f32) -> f32
pub fn process_sample(&mut self, x: f32) -> f32
Process a single mono sample. Allocation-free.
Sourcepub fn sample_rate(&self) -> f64
pub fn sample_rate(&self) -> f64
The model’s sample rate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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