pub struct LiveVisualizer<'a> { /* private fields */ }Expand description
Builder that opens a GUI window showing the live waveform of an audio
input device along with a custom Transform of it.
§Example
use audio_visualizer::live::{LiveVisualizer, Transform};
LiveVisualizer::new(Transform::waveform(|samples, _sample_rate| {
samples.iter().map(|s| s * 0.5).collect()
}))
.title("Half amplitude")
.open()
.unwrap();Implementations§
Source§impl<'a> LiveVisualizer<'a>
impl<'a> LiveVisualizer<'a>
Sourcepub fn new(transform: Transform<'a>) -> Self
pub fn new(transform: Transform<'a>) -> Self
Creates a live visualizer with the given transformation for the lower chart.
Sourcepub fn input(self, input: AudioInput) -> Self
pub fn input(self, input: AudioInput) -> Self
Sets the audio input to record from. Default: the system default input device.
Sourcepub const fn x_range(self, range: Range<f64>) -> Self
pub const fn x_range(self, range: Range<f64>) -> Self
Fixes the x-axis range of the lower chart. Default: the same time
axis as the waveform for Transform::Waveform, automatic bounds
for Transform::Points.
Sourcepub const fn y_range(self, range: Range<f64>) -> Self
pub const fn y_range(self, range: Range<f64>) -> Self
Fixes the y-axis range of the lower chart. See Self::x_range.
Sourcepub fn axis_labels(self, x: impl Into<String>, y: impl Into<String>) -> Self
pub fn axis_labels(self, x: impl Into<String>, y: impl Into<String>) -> Self
Sets the axis labels of the lower chart.
Sourcepub const fn window_size(self, width: f32, height: f32) -> Self
pub const fn window_size(self, width: f32, height: f32) -> Self
Sets the initial window size in logical pixels. Default: 1280x720.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LiveVisualizer<'a>
impl<'a> !Send for LiveVisualizer<'a>
impl<'a> !Sync for LiveVisualizer<'a>
impl<'a> !UnwindSafe for LiveVisualizer<'a>
impl<'a> Freeze for LiveVisualizer<'a>
impl<'a> Unpin for LiveVisualizer<'a>
impl<'a> UnsafeUnpin for LiveVisualizer<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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