Struct rodio::OutputStream
source · pub struct OutputStream { /* private fields */ }
Expand description
cpal::Stream
container. Also see the more useful OutputStreamHandle
.
If this is dropped playback will end & attached OutputStreamHandle
s will no longer work.
Implementations§
source§impl OutputStream
impl OutputStream
sourcepub fn try_from_device(
device: &Device
) -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_from_device( device: &Device ) -> Result<(Self, OutputStreamHandle), StreamError>
Returns a new stream & handle using the given output device and the default output configuration.
sourcepub fn try_from_device_config(
device: &Device,
config: SupportedStreamConfig
) -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_from_device_config( device: &Device, config: SupportedStreamConfig ) -> Result<(Self, OutputStreamHandle), StreamError>
Returns a new stream & handle using the given device and stream config.
If the supplied SupportedStreamConfig
is invalid for the device this function will
fail to create an output stream and instead return a StreamError
sourcepub fn try_default() -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_default() -> Result<(Self, OutputStreamHandle), StreamError>
Return a new stream & handle using the default output device.
On failure will fallback to trying any non-default output devices.