Background
sound play currently opens the default system audio output via
DeviceSinkBuilder::open_default_sink() with no way to override it. The
rodio/experimental feature includes SpeakersBuilder and
available_outputs(), which expose device enumeration and selection along with
preferred sample rates, channel counts, and buffer sizes.
Proposed changes
- Add a
--device flag to sound play accepting a device name string
- Add a
sound devices command (or sound play --list-devices) that lists
available output devices, marking the system default
- Route playback through
SpeakersBuilder when --device is supplied, falling
back to the existing default sink path when it is not
Motivation
Multi-output systems are a common case — routing to headphones vs speakers, a
USB DAC, or a specific ASIO device. This is one of the more frequently requested
audio player features and SpeakersBuilder gives us everything we need to
implement it without pulling in any new dependencies.
Notes
SpeakersBuilder is currently behind rodio/experimental, which is already
in the default feature set as of main.
Background
sound playcurrently opens the default system audio output viaDeviceSinkBuilder::open_default_sink()with no way to override it. Therodio/experimentalfeature includesSpeakersBuilderandavailable_outputs(), which expose device enumeration and selection along withpreferred sample rates, channel counts, and buffer sizes.
Proposed changes
--deviceflag tosound playaccepting a device name stringsound devicescommand (orsound play --list-devices) that listsavailable output devices, marking the system default
SpeakersBuilderwhen--deviceis supplied, fallingback to the existing default sink path when it is not
Motivation
Multi-output systems are a common case — routing to headphones vs speakers, a
USB DAC, or a specific ASIO device. This is one of the more frequently requested
audio player features and
SpeakersBuildergives us everything we need toimplement it without pulling in any new dependencies.
Notes
SpeakersBuilderis currently behindrodio/experimental, which is alreadyin the default feature set as of main.