setVolume(_:for:)
Sets the volume level for the specified device.
Declaration
@MainActor func setVolume(_ volume: Float, for device: MediaOutputDevice)Parameters
- volume:
The volume level to set, typically in the range 0.0 to 1.0.
- device:
The device for which to set the volume.
Mentioned in
Discussion
For a group of devices, individual device volume changes should influence the group volume.
Called when a device supports MediaOutputDevice.VolumeControl.absolute.
Grouping
For a group of devices, all devices in the group must support MediaOutputDevice.VolumeControl.absolute.