Package com.google.android.exoplayer2.audio

## Class AudioCapabilitiesReceiver

- java.lang.Object
- - com.google.android.exoplayer2.audio.AudioCapabilitiesReceiver

-     public final class AudioCapabilitiesReceiver
      extends Object

  Receives broadcast events indicating changes to the device's audio capabilities, notifying a `AudioCapabilitiesReceiver.Listener` when audio capability changes occur.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `AudioCapabilitiesReceiver.Listener` | Listener notified when audio capabilities change.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AudioCapabilitiesReceiver​(Context context, AudioCapabilitiesReceiver.Listener listener)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `AudioCapabilities` | `register()` | Registers the receiver, meaning it will notify the listener when audio capability changes occur.
    `void` | `unregister()` | Unregisters the receiver, meaning it will no longer notify the listener when audio capability changes occur.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AudioCapabilitiesReceiver

          public AudioCapabilitiesReceiver​(Context context,
                                           AudioCapabilitiesReceiver.Listener listener)

      Parameters:
        `context` - A context for registering the receiver.
        `listener` - The listener to notify when audio capabilities change.

  - ### Method Detail

    - #### register

          public AudioCapabilities register()

      Registers the receiver, meaning it will notify the listener when audio capability changes occur. The current audio capabilities will be returned. It is important to call `unregister()` when the receiver is no longer required.
      Returns:
        The current audio capabilities for the device.

    - #### unregister

          public void unregister()

      Unregisters the receiver, meaning it will no longer notify the listener when audio capability changes occur.