[−][src]Struct nannou_audio::stream::Stream
A clone-able handle around an audio stream.
Methods
impl<M> Stream<M>
[src]
pub fn play(&self) -> Result<(), PlayStreamError>
[src]
Command the audio device to start processing this stream.
Calling this will activate capturing/rendering, in turn calling the given audio capture/render function.
Has no effect if the stream is already running.
pub fn pause(&self) -> Result<(), PauseStreamError>
[src]
Command the audio device to stop processing this stream.
Calling this will pause rendering/capturing.
Has no effect is the stream was already paused.
pub fn is_playing(&self) -> bool
[src]
Whether or not the stream is currently playing.
pub fn is_paused(&self) -> bool
[src]
Whether or not the stream is currently paused.
pub fn send<F>(
&self,
update: F
) -> Result<(), SendError<Box<dyn FnMut(&mut M) + Send + 'static>>> where
F: FnOnce(&mut M) + Send + 'static,
[src]
&self,
update: F
) -> Result<(), SendError<Box<dyn FnMut(&mut M) + Send + 'static>>> where
F: FnOnce(&mut M) + Send + 'static,
Send the given model update to the audio thread to be applied ASAP.
If the audio is currently rendering, the update will be applied immediately after the function call completes.
If the stream is currently paused, the update will be applied immediately.
Note: This function will be applied on the real-time audio thread so users should avoid performing any kind of I/O, locking, blocking, (de)allocations or anything that may run for an indeterminate amount of time.
pub fn cpal_format(&self) -> &Format
[src]
The format with which the inner CPAL stream was created.
This should match the actual stream format that is running. If not, there may be a bug
in CPAL. However, note that if the sample_format
does not match, this just means that
nannou
is doing a conversion behind the scenes as the hardware itself does not support
the target format.
pub fn id(&self) -> &StreamId
[src]
A reference to the unique ID associated with this stream.
Trait Implementations
Auto Trait Implementations
impl<M> !Sync for Stream<M>
impl<M> Send for Stream<M> where
M: Send,
M: Send,
impl<M> Unpin for Stream<M>
impl<M> !RefUnwindSafe for Stream<M>
impl<M> !UnwindSafe for Stream<M>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<S> FromSample<S> for S
[src]
fn from_sample_(s: S) -> S
[src]
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
[src]
U: FromSample<T>,
fn to_sample_(self) -> U
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
[src]
T: FromSample<S> + ToSample<S>,