# AudioAttributesCompat

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#nestedclasses)\|[Constants](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#constants)\|[Methods](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#)  

# AudioAttributesCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
AudioAttributesCompat
`  
`

extends Object


``


`

|---|------------------------------------------------|
| java.lang.Object                                  ||
| ↳ | android.support.v4.media.AudioAttributesCompat |

<br />

*** ** * ** ***

A class to encapsulate a collection of attributes describing information about an audio stream.

`AudioAttributesCompat`supersede the notion of stream types (see for instance[STREAM_MUSIC](https://developer.android.com/reference/android/media/AudioManager.html#STREAM_MUSIC)or[STREAM_ALARM](https://developer.android.com/reference/android/media/AudioManager.html#STREAM_ALARM)) for defining the behavior of audio playback. Attributes allow an application to specify more information than is conveyed in a stream type by allowing the application to define:

- usage: "why" you are playing a sound, what is this sound used for. This is achieved with the "usage" information. Examples of usage are[USAGE_MEDIA](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_MEDIA)and[USAGE_ALARM](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ALARM). These two examples are the closest to stream types, but more detailed use cases are available. Usage information is more expressive than a stream type, and allows certain platforms or routing policies to use this information for more refined volume or routing decisions. Usage is the most important information to supply in`
  AudioAttributesCompat`and it is recommended to build any instance with this information supplied, see[AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder)for exceptions.
- content type: "what" you are playing. The content type expresses the general category of the content. This information is optional. But in case it is known (for instance[CONTENT_TYPE_MOVIE](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_MOVIE)for a movie streaming service or[CONTENT_TYPE_MUSIC](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_MUSIC)for a music playback application) this information might be used by the audio framework to selectively configure some audio post-processing blocks.
- flags: "how" is playback to be affected, see the flag definitions for the specific playback behaviors they control.

`AudioAttributesCompat`instance is built through its builder,[AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder). Also see[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)for the framework implementation of this class.

## Summary

|                                                                                                                                 ### Nested classes                                                                                                                                 ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder) Builder class for[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)objects. |

|                                                                                                                                                                                    ### Constants                                                                                                                                                                                    ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [CONTENT_TYPE_MOVIE](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_MOVIE) Content type value to use when the content type is a soundtrack, typically accompanying a movie or TV program.                                                                                                                               |
| `int` | [CONTENT_TYPE_MUSIC](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_MUSIC) Content type value to use when the content type is music.                                                                                                                                                                                    |
| `int` | [CONTENT_TYPE_SONIFICATION](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_SONIFICATION) Content type value to use when the content type is a sound used to accompany a user action, such as a beep or sound effect expressing a key click, or event, such as the type of a sound for a bonus being received in a game. |
| `int` | [CONTENT_TYPE_SPEECH](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_SPEECH) Content type value to use when the content type is speech.                                                                                                                                                                                 |
| `int` | [CONTENT_TYPE_UNKNOWN](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#CONTENT_TYPE_UNKNOWN) Content type value to use when the content type is unknown, or other than the ones defined.                                                                                                                                              |
| `int` | [FLAG_AUDIBILITY_ENFORCED](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#FLAG_AUDIBILITY_ENFORCED) Flag defining a behavior where the audibility of the sound will be ensured by the system.                                                                                                                                        |
| `int` | [FLAG_HW_AV_SYNC](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#FLAG_HW_AV_SYNC) Flag requesting the use of an output stream supporting hardware A/V synchronization.                                                                                                                                                               |
| `int` | [USAGE_ALARM](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ALARM) Usage value to use when the usage is an alarm (e.g.                                                                                                                                                                                                        |
| `int` | [USAGE_ASSISTANCE_ACCESSIBILITY](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ASSISTANCE_ACCESSIBILITY) Usage value to use when the usage is for accessibility, such as with a screen reader.                                                                                                                                |
| `int` | [USAGE_ASSISTANCE_NAVIGATION_GUIDANCE](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ASSISTANCE_NAVIGATION_GUIDANCE) Usage value to use when the usage is driving or navigation directions.                                                                                                                                   |
| `int` | [USAGE_ASSISTANCE_SONIFICATION](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ASSISTANCE_SONIFICATION) Usage value to use when the usage is sonification, such as with user interface sounds.                                                                                                                                 |
| `int` | [USAGE_ASSISTANT](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_ASSISTANT) Usage value to use for audio responses to user queries, audio instructions or help utterances.                                                                                                                                                     |
| `int` | [USAGE_GAME](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_GAME) Usage value to use when the usage is for game audio.                                                                                                                                                                                                         |
| `int` | [USAGE_MEDIA](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_MEDIA) Usage value to use when the usage is media, such as music, or movie soundtracks.                                                                                                                                                                           |
| `int` | [USAGE_NOTIFICATION](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION) Usage value to use when the usage is notification.                                                                                                                                                                                           |
| `int` | [USAGE_NOTIFICATION_COMMUNICATION_DELAYED](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION_COMMUNICATION_DELAYED) Usage value to use when the usage is notification for a non-immediate type of communication such as e-mail.                                                                                      |
| `int` | [USAGE_NOTIFICATION_COMMUNICATION_INSTANT](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION_COMMUNICATION_INSTANT) Usage value to use when the usage is notification for an "instant" communication such as a chat, or SMS.                                                                                         |
| `int` | [USAGE_NOTIFICATION_COMMUNICATION_REQUEST](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION_COMMUNICATION_REQUEST) Usage value to use when the usage is a request to enter/end a communication, such as a VoIP communication or video-conference.                                                                   |
| `int` | [USAGE_NOTIFICATION_EVENT](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION_EVENT) Usage value to use when the usage is to attract the user's attention, such as a reminder or low battery warning.                                                                                                                 |
| `int` | [USAGE_NOTIFICATION_RINGTONE](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_NOTIFICATION_RINGTONE) Usage value to use when the usage is telephony ringtone.                                                                                                                                                                   |
| `int` | [USAGE_UNKNOWN](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_UNKNOWN) Usage value to use when the usage is unknown.                                                                                                                                                                                                          |
| `int` | [USAGE_VOICE_COMMUNICATION](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_VOICE_COMMUNICATION) Usage value to use when the usage is voice communications, such as telephony or VoIP.                                                                                                                                          |
| `int` | [USAGE_VOICE_COMMUNICATION_SIGNALLING](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#USAGE_VOICE_COMMUNICATION_SIGNALLING) Usage value to use when the usage is in-call signalling, such as with a "busy" beep, or DTMF tones.                                                                                                      |

|                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                                                                | ` `[equals](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#equals(java.lang.Object))`(Object o) `                                                                                                                                                                                                                                                             |
| ` int`                                                                                                                    | ` `[getContentType](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#getContentType())`() ` Return the content type.                                                                                                                                                                                                                                            |
| ` int`                                                                                                                    | ` `[getFlags](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#getFlags())`() ` Return the flags.                                                                                                                                                                                                                                                               |
| ` int`                                                                                                                    | ` `[getLegacyStreamType](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#getLegacyStreamType())`() ` Return a stream type passed to[setLegacyStreamType(int)](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder#setLegacyStreamType(int)), or -1 if no legacy stream is available                                 |
| ` int`                                                                                                                    | ` `[getUsage](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#getUsage())`() ` Return the usage.                                                                                                                                                                                                                                                               |
| ` int`                                                                                                                    | ` `[getVolumeControlStream](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#getVolumeControlStream())`() ` Returns the stream type matching the given attributes for volume control.                                                                                                                                                                           |
| ` int`                                                                                                                    | ` `[hashCode](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#hashCode())`() `                                                                                                                                                                                                                                                                                 |
| ` String`                                                                                                                 | ` `[toString](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#toString())`() `                                                                                                                                                                                                                                                                                 |
| ` Object`                                                                                                                 | ` `[unwrap](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#unwrap())`() ` If the current SDK level is 21 or higher, return the[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)object inside this[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat). |
| ` static `[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat) | ` `[wrap](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat#wrap(java.lang.Object))`(Object aa) ` Create an[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)given an API 21[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)object.                    |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media/AudioAttributesCompat#)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() `                    | ||

## Constants

### CONTENT_TYPE_MOVIE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CONTENT_TYPE_MOVIE
```

Content type value to use when the content type is a soundtrack, typically accompanying a movie or TV program.

<br />

Constant Value: 3 (0x00000003)  

### CONTENT_TYPE_MUSIC

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CONTENT_TYPE_MUSIC
```

Content type value to use when the content type is music.

<br />

Constant Value: 2 (0x00000002)  

### CONTENT_TYPE_SONIFICATION

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CONTENT_TYPE_SONIFICATION
```

Content type value to use when the content type is a sound used to accompany a user action, such as a beep or sound effect expressing a key click, or event, such as the type of a sound for a bonus being received in a game. These sounds are mostly synthesized or short Foley sounds.

<br />

Constant Value: 4 (0x00000004)  

### CONTENT_TYPE_SPEECH

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CONTENT_TYPE_SPEECH
```

Content type value to use when the content type is speech.

<br />

Constant Value: 1 (0x00000001)  

### CONTENT_TYPE_UNKNOWN

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int CONTENT_TYPE_UNKNOWN
```

Content type value to use when the content type is unknown, or other than the ones defined.

<br />

Constant Value: 0 (0x00000000)  

### FLAG_AUDIBILITY_ENFORCED

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_AUDIBILITY_ENFORCED
```

Flag defining a behavior where the audibility of the sound will be ensured by the system.

<br />

Constant Value: 1 (0x00000001)  

### FLAG_HW_AV_SYNC

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int FLAG_HW_AV_SYNC
```

Flag requesting the use of an output stream supporting hardware A/V synchronization.

<br />

Constant Value: 16 (0x00000010)  

### USAGE_ALARM

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_ALARM
```

Usage value to use when the usage is an alarm (e.g. wake-up alarm).

<br />

Constant Value: 4 (0x00000004)  

### USAGE_ASSISTANCE_ACCESSIBILITY

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_ASSISTANCE_ACCESSIBILITY
```

Usage value to use when the usage is for accessibility, such as with a screen reader.

<br />

Constant Value: 11 (0x0000000b)  

### USAGE_ASSISTANCE_NAVIGATION_GUIDANCE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE
```

Usage value to use when the usage is driving or navigation directions.

<br />

Constant Value: 12 (0x0000000c)  

### USAGE_ASSISTANCE_SONIFICATION

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_ASSISTANCE_SONIFICATION
```

Usage value to use when the usage is sonification, such as with user interface sounds.

<br />

Constant Value: 13 (0x0000000d)  

### USAGE_ASSISTANT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_ASSISTANT
```

Usage value to use for audio responses to user queries, audio instructions or help utterances.

<br />

Constant Value: 16 (0x00000010)  

### USAGE_GAME

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_GAME
```

Usage value to use when the usage is for game audio.

<br />

Constant Value: 14 (0x0000000e)  

### USAGE_MEDIA

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_MEDIA
```

Usage value to use when the usage is media, such as music, or movie soundtracks.

<br />

Constant Value: 1 (0x00000001)  

### USAGE_NOTIFICATION

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION
```

Usage value to use when the usage is notification. See other notification usages for more specialized uses.

<br />

Constant Value: 5 (0x00000005)  

### USAGE_NOTIFICATION_COMMUNICATION_DELAYED

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION_COMMUNICATION_DELAYED
```

Usage value to use when the usage is notification for a non-immediate type of communication such as e-mail.

<br />

Constant Value: 9 (0x00000009)  

### USAGE_NOTIFICATION_COMMUNICATION_INSTANT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION_COMMUNICATION_INSTANT
```

Usage value to use when the usage is notification for an "instant" communication such as a chat, or SMS.

<br />

Constant Value: 8 (0x00000008)  

### USAGE_NOTIFICATION_COMMUNICATION_REQUEST

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION_COMMUNICATION_REQUEST
```

Usage value to use when the usage is a request to enter/end a communication, such as a VoIP communication or video-conference.

<br />

Constant Value: 7 (0x00000007)  

### USAGE_NOTIFICATION_EVENT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION_EVENT
```

Usage value to use when the usage is to attract the user's attention, such as a reminder or low battery warning.

<br />

Constant Value: 10 (0x0000000a)  

### USAGE_NOTIFICATION_RINGTONE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_NOTIFICATION_RINGTONE
```

Usage value to use when the usage is telephony ringtone.

<br />

Constant Value: 6 (0x00000006)  

### USAGE_UNKNOWN

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_UNKNOWN
```

Usage value to use when the usage is unknown.

<br />

Constant Value: 0 (0x00000000)  

### USAGE_VOICE_COMMUNICATION

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_VOICE_COMMUNICATION
```

Usage value to use when the usage is voice communications, such as telephony or VoIP.

<br />

Constant Value: 2 (0x00000002)  

### USAGE_VOICE_COMMUNICATION_SIGNALLING

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int USAGE_VOICE_COMMUNICATION_SIGNALLING
```

Usage value to use when the usage is in-call signalling, such as with a "busy" beep, or DTMF tones.

<br />

Constant Value: 3 (0x00000003)

## Public methods

### equals

```
boolean equals (Object o)
```

<br />

<br />

|      Parameters      ||
|-----|-----------------|
| `o` | `Object` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### getContentType

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getContentType ()
```

Return the content type.

<br />

|                                                                                           Returns                                                                                           ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | one of the values that can be set in[setContentType(int)](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder#setContentType(int)) <br /> |

### getFlags

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getFlags ()
```

Return the flags.

<br />

|                  Returns                   ||
|-------|-------------------------------------|
| `int` | a combined mask of all flags <br /> |

### getLegacyStreamType

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getLegacyStreamType ()
```

Return a stream type passed to[setLegacyStreamType(int)](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder#setLegacyStreamType(int)), or -1 if no legacy stream is available

<br />

|            Returns            ||
|-------|------------------------|
| `int` | the stream type <br /> |

### getUsage

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getUsage ()
```

Return the usage.

<br />

|                                                                                     Returns                                                                                     ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | one of the values that can be set in[setUsage(int)](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder#setUsage(int)) <br /> |

### getVolumeControlStream

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getVolumeControlStream ()
```

Returns the stream type matching the given attributes for volume control. Use this method to derive the stream type needed to configure the volume control slider in an[Activity](https://developer.android.com/reference/android/app/Activity.html)with[setVolumeControlStream(int)](https://developer.android.com/reference/android/app/Activity.html#setVolumeControlStream(int)).  
Do not use this method to set the stream type on an audio player object (e.g.[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html),[MediaPlayer](https://developer.android.com/reference/android/media/MediaPlayer.html)) as this is deprecated; use`AudioAttributes`instead.

<br />

|                                                                                                                                                                                                                               Returns                                                                                                                                                                                                                               ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a valid stream type for`Activity`or stream volume control that matches the attributes, or[USE_DEFAULT_STREAM_TYPE](https://developer.android.com/reference/android/media/AudioManager.html#USE_DEFAULT_STREAM_TYPE)if there isn't a direct match. Note that`USE_DEFAULT_STREAM_TYPE`is not a valid value for[setStreamVolume(int, int, int)](https://developer.android.com/reference/android/media/AudioManager.html#setStreamVolume(int, int, int)). <br /> |

### hashCode

```
int hashCode ()
```

<br />

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### toString

```
String toString ()
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### unwrap

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object unwrap ()
```

If the current SDK level is 21 or higher, return the[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)object inside this[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat). Otherwise`null`.

<br />

|                                                                  Returns                                                                   ||
|----------|----------------------------------------------------------------------------------------------------------------------------------|
| `Object` | the underlying[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)object or null <br /> |

### wrap

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
AudioAttributesCompat wrap (Object aa)
```

Create an[AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)given an API 21[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html)object.

<br />

|                                                             Parameters                                                             ||
|------|------------------------------------------------------------------------------------------------------------------------------|
| `aa` | `Object`: an instance of[AudioAttributes](https://developer.android.com/reference/android/media/AudioAttributes.html) <br /> |

|                                                                                   Returns                                                                                    ||
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| [AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat) | the new`AudioAttributesCompat`, or`null`on API \< 21 <br /> |

-

  ## Classes

  - [AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)
  - [AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder)
  - [MediaBrowserCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat)
  - [MediaBrowserCompat.ConnectionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ConnectionCallback)
  - [MediaBrowserCompat.CustomActionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.CustomActionCallback)
  - [MediaBrowserCompat.ItemCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ItemCallback)
  - [MediaBrowserCompat.MediaItem](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem)
  - [MediaBrowserCompat.SearchCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SearchCallback)
  - [MediaBrowserCompat.SubscriptionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback)
  - [MediaBrowserServiceCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat)
  - [MediaBrowserServiceCompat.BrowserRoot](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.BrowserRoot)
  - [MediaBrowserServiceCompat.Result](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.Result)
  - [MediaDescriptionCompat](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat)
  - [MediaDescriptionCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat.Builder)
  - [MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)
  - [MediaMetadataCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat.Builder)
  - [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)
  - [VolumeProviderCompat](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat)
  - [VolumeProviderCompat.Callback](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat.Callback)