diff --git a/CHANGELOG.md b/CHANGELOG.md index d9118ae..3af4d91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). ### Fixed - [config] Hexademical base does not correlate to key length +- [player] Use pipe separator in device specs for ALSA compatibility - [repo] Fix pull request template format ### Security diff --git a/README.md b/README.md index f978875..a0e6910 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Your music will start playing on the selected device. pleezer -d "?" # Use a specific device, formatted as: - # "[][:][:][:]" (case-insensitive) + # "[][|][|][|]" (case-insensitive) # # All fields are optional: # - If you don't specify a host, it will use the system default host. @@ -123,13 +123,13 @@ Your music will start playing on the selected device. # - If you don't specify a sample rate, it will use the device default sample rate. # - If you don't specify a sample format, it will use the device default sample format. pleezer -d "CoreAudio" - pleezer -d "CoreAudio:Yggdrasil+" - pleezer -d "CoreAudio:Yggdrasil+:44100" - pleezer -d "CoreAudio:Yggdrasil+:44100:f32" + pleezer -d "CoreAudio|Yggdrasil+" + pleezer -d "CoreAudio|Yggdrasil+|44100" + pleezer -d "CoreAudio|Yggdrasil+|44100|f32" - # Some more advanced examples, showing you can omit fields as long as you include the colons: - pleezer -d ":yggdrasil+" # The Yggdrasil+ device (case-insensitive) - pleezer -d "::44100" # The first device to support 44100 Hz + # Some more advanced examples, showing you can omit fields as long as you include the pipes: + pleezer -d "|yggdrasil+" # The Yggdrasil+ device (case-insensitive) + pleezer -d "||44100" # The first device to support 44100 Hz ``` Deezer streams audio at 44100 Hz exclusively. Sampling rates other than diff --git a/src/main.rs b/src/main.rs index c79c12d..a79adb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,7 @@ struct Args { /// Select the audio output device /// - /// Format: [][:][:][:] + /// Format: [][|][|][|] /// Use "?" to list available devices. /// If omitted, uses the system default output device. #[arg(short, long, default_value = None, env = "PLEEZER_DEVICE")] diff --git a/src/player.rs b/src/player.rs index a8ebaad..8abe803 100644 --- a/src/player.rs +++ b/src/player.rs @@ -145,10 +145,10 @@ impl Player { fn open_sink(device: &str) -> Result<(rodio::Sink, rodio::OutputStream)> { let (stream, handle) = { // The device string has the following format: - // [][:][::] + // "[][|][|][|]" (case-insensitive) // From left to right, the fields are optional, but each field // depends on the preceding fields being specified. - let mut components = device.split(':'); + let mut components = device.split('|'); // The host is the first field. let host = match components.next() { @@ -267,7 +267,7 @@ impl Player { if let Ok(device_name) = device.name() { let max_sample_rate = config.with_max_sample_rate(); let mut line = format!( - "{}:{}:{}:{}", + "{}|{}|{}|{}", host.id().name(), device_name, max_sample_rate.sample_rate().0,