pub struct PlayoutDeviceInfo {
pub id: PlayoutDeviceId,
pub name: String,
pub index: usize,
}Expand description
Information about a playout (speaker) device.
This struct contains the device’s unique identifier, human-readable name,
and index. Use the id field with PlatformAudio::set_playout_device()
for type-safe device selection.
§Platform Notes
- Desktop (Windows, macOS, Linux): Full device information is available.
The
idis a unique GUID, andnameis a descriptive string (e.g., “MacBook Pro Speakers”). - Android: Only a single device is reported with an empty
idandname. Audio routing (speaker, earpiece, Bluetooth, wired headset) is handled by the system viaAudioManager, not through WebRTC. UseAudioManager.setSpeakerphoneOn()to switch between speaker and earpiece on Android.
§Example
ⓘ
let audio = PlatformAudio::new()?;
for device in audio.playout_devices() {
println!("[{}] {} (ID: {})", device.index, device.name, device.id);
}Fields§
§id: PlayoutDeviceIdThe unique identifier for this device (stable across hot-plug events on desktop; empty on Android).
name: StringHuman-readable device name (empty on Android).
index: usizeDevice index (may change when devices are added/removed).
Trait Implementations§
Source§impl Clone for PlayoutDeviceInfo
impl Clone for PlayoutDeviceInfo
Source§fn clone(&self) -> PlayoutDeviceInfo
fn clone(&self) -> PlayoutDeviceInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PlayoutDeviceInfo
impl RefUnwindSafe for PlayoutDeviceInfo
impl Send for PlayoutDeviceInfo
impl Sync for PlayoutDeviceInfo
impl Unpin for PlayoutDeviceInfo
impl UnsafeUnpin for PlayoutDeviceInfo
impl UnwindSafe for PlayoutDeviceInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more