---
title: "relativeVolume(onIncrement:onDecrement:)"
framework: nowplaying
role: symbol
role_heading: Type Method
path: "nowplaying/mediadevice/capability/relativevolume(onincrement:ondecrement:)"
---

# relativeVolume(onIncrement:onDecrement:)

Returns a capability that lets the device increase or decrease its volume incrementally.

## Declaration

```swift
static func relativeVolume(onIncrement: @escaping @Sendable () async throws -> Void, onDecrement: @escaping @Sendable () async throws -> Void) -> MediaDevice.Capability
```

## Parameters

- `onIncrement`: An async closure the system calls to step the volume up by one increment.
- `onDecrement`: An async closure the system calls to step the volume down by one increment.

## Mentioned in

Publishing remote media sessions

## Discussion

Discussion Use this when the device supports stepwise volume changes but doesn’t expose an absolute level.
