Skip to main content

Module stream

Module stream 

Source
Expand description

Output audio via the OS via mixers or play directly

This module provides a builder that’s used to configure and open audio output. Once opened sources can be mixed into the output via DeviceSink::mixer.

There is also a convenience function play for using that output mixer to play a single sound.

§Buffer size

Rodio configures a default buffer size of 100ms latency regardless of the system default. This is to get a good “out of the box experience” on all systems as we found out that the system default is sometimes set completely wrong. That would lead to audio playback breaking apparently randomly on some systems.

You can manually specify the buffer size if you want lower latency. For more info see buffer_size.

If you find a good way to reliably get a good buffer size on all platforms please contribute your solution to us!

Structs§

DeviceSinkBuilder
Convenience builder for audio OS-player. It provides methods to configure several parameters of the audio output and opening default device. See examples for use-cases.
DeviceSinkConfig
Describes the OS-Sink’s configuration
MixerDeviceSink
cpal::Stream container. Use mixer() method to control output.

Enums§

DeviceSinkError
Errors that might occur when interfacing with audio output.
PlayError
An error occurred while attempting to play a sound.

Functions§

play
A convenience function. Plays a sound once. Returns a Player that can be used to control the sound.
supported_output_configs
Return all formats supported by the device.