---
title: "volume(for:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceextension/volume(for:)"
---

# volume(for:)

Gets the current volume level for the specified device.

## Declaration

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

## Parameters

- `device`: The device for which to get the volume.

## Mentioned in

Creating a media device extension

## Return Value

Return Value The current volume level, typically in the range 0.0 to 1.0.

## Discussion

Discussion Called when a device supports MediaOutputDevice.VolumeControl.absolute. Grouping For a group of devices, all devices in the group must support MediaOutputDevice.VolumeControl.absolute.
