# CarAudioManager.CarVolumeCallback

Summary:[Ctors](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#inhmethods)  

# CarAudioManager.CarVolumeCallback

`
public
static

abstract
class
CarAudioManager.CarVolumeCallback
`  
`

extends Object


``


`

|---|-----------------------------------------------------|
| java.lang.Object                                       ||
| ↳ | android.car.media.CarAudioManager.CarVolumeCallback |

<br />

*** ** * ** ***

Callback interface to receive volume change events in a car. Extend this class and register it with[CarAudioManager.registerCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)](https://developer.android.com/reference/android/car/media/CarAudioManager#registerCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback))and unregister it via[CarAudioManager.unregisterCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)](https://developer.android.com/reference/android/car/media/CarAudioManager#unregisterCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback))

## Summary

|                                                             ### Public constructors                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[CarVolumeCallback](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#CarVolumeCallback())`() ` |

|                                                                                                                        ### Public methods                                                                                                                         ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onGroupMuteChanged](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupMuteChanged(int,%20int,%20int))`(int zoneId, int groupId, int flags) ` This is called whenever a group mute state is changed. |
| ` void` | ` `[onGroupVolumeChanged](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupVolumeChanged(int,%20int,%20int))`(int zoneId, int groupId, int flags) ` This is called whenever a group volume is changed. |
| ` void` | ` `[onMasterMuteChanged](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#onMasterMuteChanged(int,%20int))`(int zoneId, int flags) ` This is called whenever the global mute state is changed.                |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### CarVolumeCallback

```
public CarVolumeCallback ()
```

<br />

<br />

## Public methods

### onGroupMuteChanged

```
public void onGroupMuteChanged (int zoneId, 
                int groupId, 
                int flags)
```

This is called whenever a group mute state is changed. The changed-to mute state is not included, the caller is encouraged to get the current group mute state via CarAudioManager.

**Notes:**

- If[CarAudioManager.AUDIO_FEATURE_VOLUME_GROUP_MUTING](https://developer.android.com/reference/android/car/media/CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING)is enabled this will be triggered on mute changes. Otherwise, car audio mute changes will trigger[onMasterMuteChanged(int, int)](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#onMasterMuteChanged(int,%20int))
- If both[CarVolumeCallback](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback)and`CarVolumeGroupEventCallback`are registered by the same app, then volume group mute changes are**only** propagated through`CarVolumeGroupEventCallback`(until it is unregistered)
- Apps are encouraged to migrate to the new callback`CarVolumeGroupEventCallback`

<br />

<br />

|                                                             Parameters                                                             ||
|-----------|-------------------------------------------------------------------------------------------------------------------------|
| `zoneId`  | `int`: Id of the audio zone that volume change happens <br />                                                           |
| `groupId` | `int`: Id of the volume group that volume is changed <br />                                                             |
| `flags`   | `int`: see[AudioManager](https://developer.android.com/reference/android/media/AudioManager)for flag definitions <br /> |

### onGroupVolumeChanged

```
public void onGroupVolumeChanged (int zoneId, 
                int groupId, 
                int flags)
```

This is called whenever a group volume is changed. The changed-to volume index is not included, the caller is encouraged to get the current group volume index via CarAudioManager.

**Notes:**

- If both[CarVolumeCallback](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback)and`CarVolumeGroupEventCallback`are registered by the same app, then volume group index changes are**only** propagated through`CarVolumeGroupEventCallback`(until it is unregistered)
- Apps are encouraged to migrate to the new callback`CarVolumeGroupEventCallback`

<br />

<br />

|                                                             Parameters                                                             ||
|-----------|-------------------------------------------------------------------------------------------------------------------------|
| `zoneId`  | `int`: Id of the audio zone that volume change happens <br />                                                           |
| `groupId` | `int`: Id of the volume group that volume is changed <br />                                                             |
| `flags`   | `int`: see[AudioManager](https://developer.android.com/reference/android/media/AudioManager)for flag definitions <br /> |

### onMasterMuteChanged

```
public void onMasterMuteChanged (int zoneId, 
                int flags)
```

This is called whenever the global mute state is changed. The changed-to global mute state is not included, the caller is encouraged to get the current global mute state via AudioManager.

**Note:** If[CarAudioManager.AUDIO_FEATURE_VOLUME_GROUP_MUTING](https://developer.android.com/reference/android/car/media/CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING)is disabled this will be triggered on mute changes. Otherwise, car audio mute changes will trigger[onGroupMuteChanged(int, int, int)](https://developer.android.com/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupMuteChanged(int,%20int,%20int))

<br />

|                                                            Parameters                                                             ||
|----------|-------------------------------------------------------------------------------------------------------------------------|
| `zoneId` | `int`: Id of the audio zone that global mute state change happens <br />                                                |
| `flags`  | `int`: see[AudioManager](https://developer.android.com/reference/android/media/AudioManager)for flag definitions <br /> |