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§
- Device
Sink Builder - 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.
- Device
Sink Config - Describes the OS-Sink’s configuration
- Mixer
Device Sink cpal::Streamcontainer. Usemixer()method to control output.
Enums§
- Device
Sink Error - Errors that might occur when interfacing with audio output.
- Play
Error - An error occurred while attempting to play a sound.
Functions§
- play
- A convenience function. Plays a sound once.
Returns a
Playerthat can be used to control the sound. - supported_
output_ configs - Return all formats supported by the device.