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

# changeVolume(by:for:)

Changes the volume by a specified number of increments for the specified device.

```
@MainActor func changeVolume(by increments: Int, for device: MediaOutputDevice)
```

## Parameters

`increments`

The number of volume increments to increase or decrease by.

`device`

The device for which to change the volume.

## Discussion

For a group of devices, individual device volume changes should influence the group volume.

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

## Grouping

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

---

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)