Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/media/quality/SoundProfile#nestedclasses) \| [Constants](https://developer.android.com/reference/android/media/quality/SoundProfile#constants) \| [Inherited Constants](https://developer.android.com/reference/android/media/quality/SoundProfile#inhconstants) \| [Fields](https://developer.android.com/reference/android/media/quality/SoundProfile#lfields) \| [Methods](https://developer.android.com/reference/android/media/quality/SoundProfile#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/quality/SoundProfile#inhmethods)

# SoundProfile

*** ** * ** ***

` public final class SoundProfile `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.quality.SoundProfile |

<br />

*** ** * ** ***

Profile for sound quality.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/media/quality/SoundProfile.Builder` A builder for `https://developer.android.com/reference/android/media/quality/SoundProfile` |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#ERROR_DUPLICATE` Error code for creating a profile with existing profile type and name. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#ERROR_INVALID_ARGUMENT` Error code for invalid argument. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#ERROR_NOT_ALLOWLISTED` Error code for the case when an operation requires an allowlist but the caller is not in the list. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#ERROR_NO_PERMISSION` Error code for missing necessary permission to handle the profiles. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#ERROR_UNKNOWN` Error code for unknown errors. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_DEFAULT` Name for the default sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_MOVIE` Name for the movie sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_MUSIC` Name for the music sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_NEWS` Name for the news sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_SPORTS` Name for the sports sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_STANDARD` Name for the standard sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_USER` Name for the user-defined sound profile. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/quality/SoundProfile#NAME_VIVID` Name for the vivid sound profile. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#TYPE_APPLICATION` Application profile type. |
| `int` | `https://developer.android.com/reference/android/media/quality/SoundProfile#TYPE_SYSTEM` System profile type. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/media/quality/SoundProfile>` | `https://developer.android.com/reference/android/media/quality/SoundProfile#CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getInputId()() ` Gets the input ID if the profile is for a TV input. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getName()() ` Gets the profile name. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getPackageName()() ` Gets the package name of this profile. |
| ` https://developer.android.com/reference/android/os/PersistableBundle` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getParameters()() ` Gets the parameters of this profile. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getProfileId()() ` Gets profile ID. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#getProfileType()() ` Gets profile type. |
| ` void` | ` https://developer.android.com/reference/android/media/quality/SoundProfile#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### ERROR_DUPLICATE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_DUPLICATE
```

Error code for creating a profile with existing profile type and name.

<br />

**See also:**

- `https://developer.android.com/reference/android/media/quality/SoundProfile#getProfileType()`
- `https://developer.android.com/reference/android/media/quality/SoundProfile#getName()`

Constant Value: 2 (0x00000002)

### ERROR_INVALID_ARGUMENT

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_INVALID_ARGUMENT
```

Error code for invalid argument.

<br />

Constant Value: 3 (0x00000003)

### ERROR_NOT_ALLOWLISTED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_NOT_ALLOWLISTED
```

Error code for the case when an operation requires an allowlist but the caller is not in the list.

<br />

**See also:**

- `https://developer.android.com/`

Constant Value: 4 (0x00000004)

### ERROR_NO_PERMISSION

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_NO_PERMISSION
```

Error code for missing necessary permission to handle the profiles.

<br />

Constant Value: 1 (0x00000001)

### ERROR_UNKNOWN

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR_UNKNOWN
```

Error code for unknown errors.

<br />

Constant Value: 0 (0x00000000)

### NAME_DEFAULT

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_DEFAULT
```

Name for the default sound profile.

This profile represents the system's baseline configuration and is used when no specific profile is selected.

<br />

Constant Value: "default"

### NAME_MOVIE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_MOVIE
```

Name for the movie sound profile.

This profile is typically optimized for cinematic content, often enhancing surround sound effects and dialogue clarity.

<br />

Constant Value: "movie"

### NAME_MUSIC

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_MUSIC
```

Name for the music sound profile.

This profile is typically optimized for music playback, prioritizing audio fidelity and instrumental balance.

<br />

Constant Value: "music"

### NAME_NEWS

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_NEWS
```

Name for the news sound profile.

This profile is typically optimized for news broadcasts, prioritizing speech intelligibility and vocal clarity.

<br />

Constant Value: "news"

### NAME_SPORTS

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_SPORTS
```

Name for the sports sound profile.

This profile is typically optimized for sporting events, emphasizing commentary and crowd atmosphere.

<br />

Constant Value: "sports"

### NAME_STANDARD

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_STANDARD
```

Name for the standard sound profile.

This profile is typically optimized for general listening conditions and standard content types.

<br />

Constant Value: "standard"

### NAME_USER

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_USER
```

Name for the user-defined sound profile.

This profile represents custom settings configured by the user.

<br />

Constant Value: "user"

### NAME_VIVID

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String NAME_VIVID
```

Name for the vivid sound profile.

This profile typically emphasizes sound dynamics and distinct characteristics to create a more exciting audio experience.

<br />

Constant Value: "vivid"

### TYPE_APPLICATION

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_APPLICATION
```

Application profile type.

A profile of application type is managed by the package returned by `https://developer.android.com/reference/android/media/quality/SoundProfile#getPackageName()`.

<br />

Constant Value: 2 (0x00000002)

### TYPE_SYSTEM

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_SYSTEM
```

System profile type.

A profile of system type is managed by the system, and readable to the package returned by `https://developer.android.com/reference/android/media/quality/SoundProfile#getPackageName()`.

<br />

Constant Value: 1 (0x00000001)

## Fields

### CREATOR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SoundProfile> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getInputId

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getInputId ()
```

Gets the input ID if the profile is for a TV input.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the corresponding TV input ID; `null` if the profile is not associated with a TV input. <br /> |

**See also:**

- `https://developer.android.com/reference/android/media/tv/TvInputInfo#getId()`

### getName

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getName ()
```

Gets the profile name.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getPackageName

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPackageName ()
```

Gets the package name of this profile.

The package name defines the user of a profile. Only this specific package and system app can access to this profile.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the package name; `null` if the profile is built locally using `https://developer.android.com/reference/android/media/quality/SoundProfile.Builder` and the package is not set. <br /> |

### getParameters

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PersistableBundle getParameters ()
```

Gets the parameters of this profile.

The keys of commonly used parameters can be found in `https://developer.android.com/reference/android/media/quality/MediaQualityContract.SoundQuality`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/PersistableBundle` | The profile parameters. Empty bundle if parameters are not included in a query. <br /> |

### getProfileId

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getProfileId ()
```

Gets profile ID.

A profile ID is a globally unique ID generated and assigned by the system. For profile objects retrieved from system (e.g `https://developer.android.com/reference/android/media/quality/MediaQualityManager#getAvailableSoundProfiles(android.media.quality.MediaQualityManager.ProfileQueryParams)`) this profile ID is non-null; For profiles built locally with `https://developer.android.com/reference/android/media/quality/SoundProfile.Builder`, it's `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the unique profile ID; `null` if the profile is built locally with `https://developer.android.com/reference/android/media/quality/SoundProfile.Builder`. <br /> |

### getProfileType

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getProfileType ()
```

Gets profile type.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/media/quality/SoundProfile#TYPE_SYSTEM` - `https://developer.android.com/reference/android/media/quality/SoundProfile#TYPE_APPLICATION` |

### writeToParcel

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |