pub mod a2;
pub mod container;
pub mod convnet;
pub mod linear;
pub mod linear_fft;
pub mod lstm;
pub mod slimmable;
pub mod wavenet;
mod nam_model;
mod static_model;
mod sealed {
pub trait Sealed {}
}
pub trait NamModel: Send + Sync + sealed::Sealed {
fn process(&mut self, input: &[f32], output: &mut [f32]);
fn prewarm(&mut self, num_samples: usize);
fn prewarm_on_reset(&self) -> bool {
true
}
fn set_prewarm_on_reset(&mut self, _val: bool) {}
fn reset(&mut self, _sample_rate: u32, max_buffer_size: usize) -> anyhow::Result<()> {
if self.prewarm_on_reset() {
self.prewarm(max_buffer_size);
}
Ok(())
}
fn set_max_buffer_size(&mut self, _max_buf: usize) -> anyhow::Result<()> {
Ok(())
}
fn prewarm_samples(&self) -> usize {
0
}
fn slimmable_breakpoints(&self) -> Vec<f64> {
vec![]
}
}
pub enum StaticModel {
WavenetStandard(Box<wavenet::WaveNetModel<16, 3, 8>>),
WavenetLite(Box<wavenet::WaveNetModel<12, 3, 6>>),
WavenetFeather(Box<wavenet::WaveNetModel<8, 3, 4>>),
WavenetNano(Box<wavenet::WaveNetModel<4, 3, 2>>),
WavenetA2Full(Box<a2::WaveNetA2<8>>),
WavenetA2Lite(Box<a2::WaveNetA2<3>>),
WavenetA2Dyn(Box<a2::WaveNetA2Dyn>),
WavenetA2Cascade(Box<a2::WaveNetA2Cascade>),
WavenetDyn(Box<wavenet::WaveNetModelDyn>),
Lstm1x3(Box<lstm::Lstm1x3>),
Lstm1x8(Box<lstm::Lstm1x8>),
Lstm1x12(Box<lstm::Lstm1x12>),
Lstm1x16(Box<lstm::Lstm1x16>),
Lstm1x24(Box<lstm::Lstm1x24>),
Lstm2x8(Box<lstm::Lstm2x8>),
Lstm2x12(Box<lstm::Lstm2x12>),
Lstm2x16(Box<lstm::Lstm2x16>),
Lstm1x40(Box<lstm::Lstm1x40>),
Lstm2x24(Box<lstm::Lstm2x24>),
LstmDyn(Box<lstm::LstmModelDyn>),
Container(Box<container::ContainerModel>),
Linear(Box<linear::LinearModel>),
ConvNet(Box<convnet::ConvNetModel>),
}
impl sealed::Sealed for StaticModel {}
pub(crate) use static_model::clone_condition_dsp;