Struct rodio::Sink [−][src]
pub struct Sink { /* fields omitted */ }
Expand description
Handle to an device that outputs sounds.
Dropping the Sink
stops all sounds. You can use detach
if you want the sounds to continue
playing.
Implementations
impl Sink
[src]
impl Sink
[src]pub fn try_new(stream: &OutputStreamHandle) -> Result<Sink, PlayError>
[src]
pub fn try_new(stream: &OutputStreamHandle) -> Result<Sink, PlayError>
[src]Builds a new Sink
, beginning playback on a stream.
pub fn append<S>(&self, source: S) where
S: Source + Send + 'static,
S::Item: Sample,
S::Item: Send,
[src]
pub fn append<S>(&self, source: S) where
S: Source + Send + 'static,
S::Item: Sample,
S::Item: Send,
[src]Appends a sound to the queue of sounds to play.
pub fn volume(&self) -> f32
[src]
pub fn volume(&self) -> f32
[src]Gets the volume of the sound.
The value 1.0
is the “normal” volume (unfiltered input). Any value other than 1.0 will
multiply each sample by this value.
pub fn set_volume(&self, value: f32)
[src]
pub fn set_volume(&self, value: f32)
[src]Changes the volume of the sound.
The value 1.0
is the “normal” volume (unfiltered input). Any value other than 1.0
will
multiply each sample by this value.
pub fn pause(&self)
[src]
pub fn pause(&self)
[src]Pauses playback of this sink.
No effect if already paused.
A paused sink can be resumed with play()
.
pub fn is_paused(&self) -> bool
[src]
pub fn is_paused(&self) -> bool
[src]Gets if a sink is paused
Sinks can be paused and resumed using pause()
and play()
. This returns true
if the
sink is paused.
pub fn sleep_until_end(&self)
[src]
pub fn sleep_until_end(&self)
[src]Sleeps the current thread until the sound ends.