---
title: "volumeChanged(for:)"
framework: mediadevice
role: symbol
role_heading: Instance Method
path: "mediadevice/mediadeviceroutingmanager/volumechanged(for:)"
---

# volumeChanged(for:)

Notifies the system that the volume state has changed on a remote device.

## Declaration

```swift
@MainActor final func volumeChanged(for device: MediaOutputDevice)
```

## Parameters

- `device`: The device whose volume state has changed.

## Mentioned in

Creating a media device extension

## Discussion

Discussion Call this function when the remote device’s volume level or mute state changes independently of system-initiated volume control calls. This is typically needed when: The device’s physical volume buttons are pressed The device’s volume is changed through its own interface or remote control Another application or service modifies the device’s volume The device automatically adjusts volume (for example, due to content normalization) After calling this function, the system will query the current volume state by calling the appropriate getter based on the device’s volumeControl: For MediaOutputDevice.VolumeControl.absolute devices: volume(for:) and/or isDeviceMuted(_:) will be called (if canMute is true) For MediaOutputDevice.VolumeControl.relative devices: isDeviceMuted(_:) will be called (if canMute is true) important: Do not call this function in response to system-initiated volume changes (for example, when setVolume(_:for:), changeVolume(by:for:), or muteDevice(_:) are called). Only call it for external or device-initiated volume changes. note: For device groups, call this function once for the group rather than for each individual member device, unless individual devices can have independent volume changes. note: MediaOutputDevice.VolumeControl note: volume(for:) note: isDeviceMuted(_:)
