From a4e3bec635b9f6a9f1612206c763b62dc7726a79 Mon Sep 17 00:00:00 2001 From: Will Evans Date: Thu, 27 Mar 2025 08:59:27 +0000 Subject: [PATCH] Improve AAudio device names --- src/host/aaudio/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/host/aaudio/mod.rs b/src/host/aaudio/mod.rs index 4372c1dc1..f5f024461 100644 --- a/src/host/aaudio/mod.rs +++ b/src/host/aaudio/mod.rs @@ -313,7 +313,17 @@ impl DeviceTrait for Device { fn name(&self) -> Result { match &self.0 { None => Ok("default".to_owned()), - Some(info) => Ok(info.product_name.clone()), + Some(info) => { + let name = if info.address.is_empty() { + format!("{}:{:?}", info.product_name, info.device_type) + } else { + format!( + "{}:{:?}:{}", + info.product_name, info.device_type, info.address + ) + }; + Ok(name) + } } }