Trait cpal::traits::StreamTrait[][src]

pub trait StreamTrait {
    fn play(&self) -> Result<(), PlayStreamError>;
fn pause(&self) -> Result<(), PauseStreamError>; }

A stream created from Device, with methods to control playback.

Required methods

fn play(&self) -> Result<(), PlayStreamError>[src]

Run the stream.

Note: Not all platforms automatically run the stream upon creation, so it is important to call play after creation if it is expected that the stream should run immediately.

fn pause(&self) -> Result<(), PauseStreamError>[src]

Some devices support pausing the audio stream. This can be useful for saving energy in moments of silence.

Note: Not all devices support suspending the stream at the hardware level. This method may fail in these cases.

Loading content...

Implementors

impl StreamTrait for cpal::platform::AlsaStream[src]

impl StreamTrait for cpal::platform::Stream[src]

Loading content...