pub struct ResampleFilter { /* private fields */ }Expand description
Audio resampling filter using sinc interpolation.
This filter converts audio between different sample rates using high-quality sinc interpolation with a Kaiser window.
§Example
ⓘ
use oximedia_graph::filters::audio::resample::{ResampleFilter, ResampleConfig, ResampleQuality};
let config = ResampleConfig::new(48000, 44100)
.with_quality(ResampleQuality::High);
let filter = ResampleFilter::new(NodeId(0), "resample", config);Implementations§
Source§impl ResampleFilter
impl ResampleFilter
Sourcepub fn new(id: NodeId, name: impl Into<String>, config: ResampleConfig) -> Self
pub fn new(id: NodeId, name: impl Into<String>, config: ResampleConfig) -> Self
Create a new resample filter.
Sourcepub fn config(&self) -> &ResampleConfig
pub fn config(&self) -> &ResampleConfig
Get the current configuration.
Sourcepub fn set_config(&mut self, config: ResampleConfig)
pub fn set_config(&mut self, config: ResampleConfig)
Update the configuration.
Trait Implementations§
Source§impl Node for ResampleFilter
impl Node for ResampleFilter
Source§fn outputs(&self) -> &[OutputPort]
fn outputs(&self) -> &[OutputPort]
Get the node’s output ports.
Source§fn initialize(&mut self) -> GraphResult<()>
fn initialize(&mut self) -> GraphResult<()>
Initialize the node before processing starts.
Source§fn process(
&mut self,
input: Option<FilterFrame>,
) -> GraphResult<Option<FilterFrame>>
fn process( &mut self, input: Option<FilterFrame>, ) -> GraphResult<Option<FilterFrame>>
Process available input and produce output. Read more
Source§fn flush(&mut self) -> GraphResult<Vec<FilterFrame>>
fn flush(&mut self) -> GraphResult<Vec<FilterFrame>>
Flush any buffered data.
Source§fn reset(&mut self) -> GraphResult<()>
fn reset(&mut self) -> GraphResult<()>
Reset the node to initial state.
Source§fn output_port(&self, id: PortId) -> Option<&OutputPort>
fn output_port(&self, id: PortId) -> Option<&OutputPort>
Get output port by ID.
Source§fn accepts_input(&self, port_type: PortType) -> bool
fn accepts_input(&self, port_type: PortType) -> bool
Check if node accepts the given port type as input.
Source§fn produces_output(&self, port_type: PortType) -> bool
fn produces_output(&self, port_type: PortType) -> bool
Check if node produces the given port type as output.
Auto Trait Implementations§
impl Freeze for ResampleFilter
impl RefUnwindSafe for ResampleFilter
impl Send for ResampleFilter
impl Sync for ResampleFilter
impl Unpin for ResampleFilter
impl UnsafeUnpin for ResampleFilter
impl UnwindSafe for ResampleFilter
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
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