Struct rodio::Sink
[−]
[src]
pub struct Sink { /* fields omitted */ }
Handle to an endpoint that outputs sounds.
Dropping the Sink
stops all sounds. You can use detach
if you want the sounds to continue
playing.
Methods
impl Sink
[src]
fn new(endpoint: &Endpoint) -> Sink
Builds a new Sink
.
fn append<S>(&self, source: S) where
S: Source + Send + 'static,
S::Item: Sample,
S::Item: Send,
S: Source + Send + 'static,
S::Item: Sample,
S::Item: Send,
Appends a sound to the queue of sounds to play.
fn volume(&self) -> f32
The value 1.0
is the "normal" volume (unfiltered input). Any value other than 1.0 will
multiply each sample by this value.
fn set_volume(&mut self, value: f32)
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.
fn play(&self)
Resumes playback of a paused sound.
No effect if not paused.
fn pause(&self)
Pauses playback of this sink.
No effect if already paused.
A paused sound can be resumed with play()
.
fn is_paused(&self) -> bool
Gets if a sound is paused
Sounds can be paused and resumed using pause() and play(). This gets if a sound is paused.
fn stop(&self)
Stops the sink by emptying the queue.
fn detach(self)
Destroys the sink without stopping the sounds that are still playing.
fn sleep_until_end(&self)
Sleeps the current thread until the sound ends.
fn empty(&self) -> bool
Returns true if this sink has no more sounds to play.