<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceExtension/volume(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB9ExtensionP6volume3forSfAA0a6OutputB0V_tF"
  },
  "title" : "volume(for:)"
}
-->

# volume(for:)

Gets the current volume level for the specified device.

```
@MainActor func volume(for device: MediaOutputDevice) -> Float
```

## Parameters

`device`

The device for which to get the volume.

## Return Value

The current volume level in the range 0.0 to 1.0.

## Discussion

Called when a device supports [`MediaOutputDevice.VolumeControl.absolute`](/documentation/MediaDevice/MediaOutputDevice/VolumeControl-swift.enum/absolute).

## Grouping

For a group of devices, all devices in the group must support [`MediaOutputDevice.VolumeControl.absolute`](/documentation/MediaDevice/MediaOutputDevice/VolumeControl-swift.enum/absolute).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)