Skip to content

feat: add --device flag to sound play for output device selection #27

@SuaveIV

Description

@SuaveIV

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions