# BluetoothCodecConfig

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

# BluetoothCodecConfig

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothCodecConfig "View this page in Kotlin")\|Java

`
public

final

class
BluetoothCodecConfig
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.BluetoothCodecConfig |

<br />

*** ** * ** ***

Represents the codec configuration for a Bluetooth A2DP source device.

Contains the source codec type, the codec priority, the codec sample rate, the codec bits per sample, and the codec channel mode.

The source codec type values are the same as those supported by the device hardware.  
**See also:**

- [BluetoothA2dp](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp)

## Summary

|                                                                                                                 ### Nested classes                                                                                                                  ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [BluetoothCodecConfig.Builder](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig.Builder) Builder for[BluetoothCodecConfig](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig). |

|                                                                                                                                                                                                                               ### Constants                                                                                                                                                                                                                                ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [BITS_PER_SAMPLE_16](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_16) Codec bits per sample 16.                                                                                                                                                                                                                                                                                                                   |
| `int` | [BITS_PER_SAMPLE_24](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_24) Codec bits per sample 24.                                                                                                                                                                                                                                                                                                                   |
| `int` | [BITS_PER_SAMPLE_32](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_32) Codec bits per sample 32.                                                                                                                                                                                                                                                                                                                   |
| `int` | [BITS_PER_SAMPLE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_NONE) Codec bits per sample 0.                                                                                                                                                                                                                                                                                                                |
| `int` | [CHANNEL_MODE_MONO](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_MONO) Codec channel mode MONO.                                                                                                                                                                                                                                                                                                                      |
| `int` | [CHANNEL_MODE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_NONE) Codec channel mode NONE.                                                                                                                                                                                                                                                                                                                      |
| `int` | [CHANNEL_MODE_STEREO](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_STEREO) Codec channel mode STEREO.                                                                                                                                                                                                                                                                                                                |
| `int` | [CODEC_PRIORITY_DEFAULT](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_DEFAULT) Codec priority default.                                                                                                                                                                                                                                                                                                             |
| `int` | [CODEC_PRIORITY_DISABLED](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_DISABLED) Codec priority disabled.                                                                                                                                                                                                                                                                                                          |
| `int` | [CODEC_PRIORITY_HIGHEST](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_HIGHEST) Codec priority highest.                                                                                                                                                                                                                                                                                                             |
| `int` | [SAMPLE_RATE_176400](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_176400) Codec sample rate 176400 Hz.                                                                                                                                                                                                                                                                                                                |
| `int` | [SAMPLE_RATE_192000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_192000) Codec sample rate 192000 Hz.                                                                                                                                                                                                                                                                                                                |
| `int` | [SAMPLE_RATE_44100](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_44100) Codec sample rate 44100 Hz.                                                                                                                                                                                                                                                                                                                   |
| `int` | [SAMPLE_RATE_48000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_48000) Codec sample rate 48000 Hz.                                                                                                                                                                                                                                                                                                                   |
| `int` | [SAMPLE_RATE_88200](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_88200) Codec sample rate 88200 Hz.                                                                                                                                                                                                                                                                                                                   |
| `int` | [SAMPLE_RATE_96000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_96000) Codec sample rate 96000 Hz.                                                                                                                                                                                                                                                                                                                   |
| `int` | [SAMPLE_RATE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_NONE) Codec sample rate 0 Hz.                                                                                                                                                                                                                                                                                                                         |
| `int` | [SOURCE_CODEC_TYPE_AAC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_AAC) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*         |
| `int` | [SOURCE_CODEC_TYPE_APTX](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_APTX) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*       |
| `int` | [SOURCE_CODEC_TYPE_APTX_HD](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_APTX_HD) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.* |
| `int` | [SOURCE_CODEC_TYPE_INVALID](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_INVALID) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.* |
| `int` | [SOURCE_CODEC_TYPE_LC3](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_LC3) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*         |
| `int` | [SOURCE_CODEC_TYPE_LDAC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_LDAC) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*       |
| `int` | [SOURCE_CODEC_TYPE_OPUS](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_OPUS) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*       |
| `int` | [SOURCE_CODEC_TYPE_SBC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_SBC) *This constant was deprecated in API level 35. Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.*         |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](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 `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[BluetoothCodecConfig](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig)`>` | [CREATOR](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CREATOR) <br /> |

|                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                            ||
|-------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                                            | ` `[equals](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` o) ` Indicates whether some other object is "equal to" this one.                                                                       |
| ` int`                                                                                                | ` `[getBitsPerSample](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getBitsPerSample())`() ` Returns the codec bits per sample.                                                                                                                                                                  |
| ` int`                                                                                                | ` `[getChannelMode](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getChannelMode())`() ` Returns the codec channel mode.                                                                                                                                                                         |
| ` int`                                                                                                | ` `[getCodecPriority](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecPriority())`() ` Returns the codec selection priority.                                                                                                                                                               |
| ` long`                                                                                               | ` `[getCodecSpecific1](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecSpecific1())`() ` Returns the codec specific value1.                                                                                                                                                                |
| ` long`                                                                                               | ` `[getCodecSpecific2](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecSpecific2())`() ` Returns the codec specific value2.                                                                                                                                                                |
| ` long`                                                                                               | ` `[getCodecSpecific3](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecSpecific3())`() ` Returns the codec specific value3.                                                                                                                                                                |
| ` long`                                                                                               | ` `[getCodecSpecific4](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecSpecific4())`() ` Returns the codec specific value4.                                                                                                                                                                |
| ` int`                                                                                                | ` `[getCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getCodecType())`() ` *This method was deprecated in API level 35. use[BluetoothCodecConfig.getExtendedCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getExtendedCodecType())instead.* |
| ` `[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType) | ` `[getExtendedCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getExtendedCodecType())`() ` Returns the source codec type of this config.                                                                                                                                               |
| ` int`                                                                                                | ` `[getSampleRate](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getSampleRate())`() ` Returns the codec sample rate.                                                                                                                                                                            |
| ` int`                                                                                                | ` `[hashCode](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#hashCode())`() ` Returns a hash representation of this BluetoothCodecConfig based on all the config values.                                                                                                                          |
| ` boolean`                                                                                            | ` `[isMandatoryCodec](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#isMandatoryCodec())`() ` Checks whether the codec is mandatory.                                                                                                                                                              |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                 | ` `[toString](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#toString())`() ` Returns a[String](https://developer.android.com/reference/java/lang/String)that describes each BluetoothCodecConfig parameter current value.                                                                        |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](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` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### BITS_PER_SAMPLE_16

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

```
public static final int BITS_PER_SAMPLE_16
```

Codec bits per sample 16.

<br />

Constant Value: 1 (0x00000001)  

### BITS_PER_SAMPLE_24

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

```
public static final int BITS_PER_SAMPLE_24
```

Codec bits per sample 24.

<br />

Constant Value: 2 (0x00000002)  

### BITS_PER_SAMPLE_32

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

```
public static final int BITS_PER_SAMPLE_32
```

Codec bits per sample 32.

<br />

Constant Value: 4 (0x00000004)  

### BITS_PER_SAMPLE_NONE

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

```
public static final int BITS_PER_SAMPLE_NONE
```

Codec bits per sample 0. Default value of the codec bits per sample.

<br />

Constant Value: 0 (0x00000000)  

### CHANNEL_MODE_MONO

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

```
public static final int CHANNEL_MODE_MONO
```

Codec channel mode MONO.

<br />

Constant Value: 1 (0x00000001)  

### CHANNEL_MODE_NONE

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

```
public static final int CHANNEL_MODE_NONE
```

Codec channel mode NONE. Default value of the codec channel mode.

<br />

Constant Value: 0 (0x00000000)  

### CHANNEL_MODE_STEREO

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

```
public static final int CHANNEL_MODE_STEREO
```

Codec channel mode STEREO.

<br />

Constant Value: 2 (0x00000002)  

### CODEC_PRIORITY_DEFAULT

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

```
public static final int CODEC_PRIORITY_DEFAULT
```

Codec priority default. Default value used for codec priority.

<br />

Constant Value: 0 (0x00000000)  

### CODEC_PRIORITY_DISABLED

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

```
public static final int CODEC_PRIORITY_DISABLED
```

Codec priority disabled. Used to indicate that this codec is disabled and should not be used.

<br />

Constant Value: -1 (0xffffffff)  

### CODEC_PRIORITY_HIGHEST

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

```
public static final int CODEC_PRIORITY_HIGHEST
```

Codec priority highest. Used to indicate the highest priority a codec can have.

<br />

Constant Value: 1000000 (0x000f4240)  

### SAMPLE_RATE_176400

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

```
public static final int SAMPLE_RATE_176400
```

Codec sample rate 176400 Hz.

<br />

Constant Value: 16 (0x00000010)  

### SAMPLE_RATE_192000

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

```
public static final int SAMPLE_RATE_192000
```

Codec sample rate 192000 Hz.

<br />

Constant Value: 32 (0x00000020)  

### SAMPLE_RATE_44100

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

```
public static final int SAMPLE_RATE_44100
```

Codec sample rate 44100 Hz.

<br />

Constant Value: 1 (0x00000001)  

### SAMPLE_RATE_48000

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

```
public static final int SAMPLE_RATE_48000
```

Codec sample rate 48000 Hz.

<br />

Constant Value: 2 (0x00000002)  

### SAMPLE_RATE_88200

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

```
public static final int SAMPLE_RATE_88200
```

Codec sample rate 88200 Hz.

<br />

Constant Value: 4 (0x00000004)  

### SAMPLE_RATE_96000

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

```
public static final int SAMPLE_RATE_96000
```

Codec sample rate 96000 Hz.

<br />

Constant Value: 8 (0x00000008)  

### SAMPLE_RATE_NONE

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

```
public static final int SAMPLE_RATE_NONE
```

Codec sample rate 0 Hz. Default value used for codec sample rate.

<br />

Constant Value: 0 (0x00000000)  

### SOURCE_CODEC_TYPE_AAC

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

```
public static final int SOURCE_CODEC_TYPE_AAC
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type AAC.

<br />

Constant Value: 1 (0x00000001)  

### SOURCE_CODEC_TYPE_APTX

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

```
public static final int SOURCE_CODEC_TYPE_APTX
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type APTX.

<br />

Constant Value: 2 (0x00000002)  

### SOURCE_CODEC_TYPE_APTX_HD

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

```
public static final int SOURCE_CODEC_TYPE_APTX_HD
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type APTX HD.

<br />

Constant Value: 3 (0x00000003)  

### SOURCE_CODEC_TYPE_INVALID

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

```
public static final int SOURCE_CODEC_TYPE_INVALID
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type invalid. This is the default value used for codec type.

<br />

Constant Value: 1000000 (0x000f4240)  

### SOURCE_CODEC_TYPE_LC3

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

```
public static final int SOURCE_CODEC_TYPE_LC3
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type LC3.

<br />

Constant Value: 5 (0x00000005)  

### SOURCE_CODEC_TYPE_LDAC

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

```
public static final int SOURCE_CODEC_TYPE_LDAC
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type LDAC.

<br />

Constant Value: 4 (0x00000004)  

### SOURCE_CODEC_TYPE_OPUS

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

```
public static final int SOURCE_CODEC_TYPE_OPUS
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type Opus.

<br />

Constant Value: 6 (0x00000006)  

### SOURCE_CODEC_TYPE_SBC

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

```
public static final int SOURCE_CODEC_TYPE_SBC
```

<br />

**This constant was deprecated in API level 35.**   
Use the[BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType)values returned by[BluetoothA2dp.getSupportedCodecTypes()](https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#getSupportedCodecTypes())instead.

Source codec type SBC. This is the mandatory source codec type.

<br />

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

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

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

<br />

<br />

## Public methods

### equals

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

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

Indicates whether some other object is "equal to" this one.

The`equals`method implements an equivalence relation on non-null object references:

- It is*reflexive* : for any non-null reference value`x`,`x.equals(x)`should return`true`.
- It is*symmetric* : for any non-null reference values`x`and`y`,`x.equals(y)`should return`true`if and only if`y.equals(x)`returns`true`.
- It is*transitive* : for any non-null reference values`x`,`y`, and`z`, if`x.equals(y)`returns`true`and`y.equals(z)`returns`true`, then`x.equals(z)`should return`true`.
- It is*consistent* : for any non-null reference values`x`and`y`, multiple invocations of`x.equals(y)`consistently return`true`or consistently return`false`, provided no information used in`equals`comparisons on the objects is modified.
- For any non-null reference value`x`,`x.equals(null)`should return`false`.

An equivalence relation partitions the elements it operates on into*equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

|                   Parameters                   ||
|-----|-------------------------------------------|
| `o` | `Object`: This value may be`null`. <br /> |

|                                         Returns                                          ||
|-----------|-------------------------------------------------------------------------------|
| `boolean` | `true`if this object is the same as the obj argument;`false`otherwise. <br /> |

### getBitsPerSample

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

```
public int getBitsPerSample ()
```

Returns the codec bits per sample. The value can be a bitmask with all bits per sample supported.

<br />

|                                                                                                                                                                                                                                                           Returns                                                                                                                                                                                                                                                            ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[BITS_PER_SAMPLE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_NONE),[BITS_PER_SAMPLE_16](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_16),[BITS_PER_SAMPLE_24](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_24), or[BITS_PER_SAMPLE_32](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#BITS_PER_SAMPLE_32) <br /> |

### getChannelMode

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

```
public int getChannelMode ()
```

Returns the codec channel mode. The value can be a bitmask with all supported channel modes.

<br />

|                                                                                                                                                                                            Returns                                                                                                                                                                                             ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[CHANNEL_MODE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_NONE),[CHANNEL_MODE_MONO](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_MONO), or[CHANNEL_MODE_STEREO](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CHANNEL_MODE_STEREO) <br /> |

### getCodecPriority

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

```
public int getCodecPriority ()
```

Returns the codec selection priority.

The codec selection priority is relative to other codecs: larger value means higher priority.

<br />

|                                                                                                                                                                                                          Returns                                                                                                                                                                                                           ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[CODEC_PRIORITY_DISABLED](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_DISABLED),[CODEC_PRIORITY_DEFAULT](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_DEFAULT), or[CODEC_PRIORITY_HIGHEST](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#CODEC_PRIORITY_HIGHEST) <br /> |

### getCodecSpecific1

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

```
public long getCodecSpecific1 ()
```

Returns the codec specific value1. As the value and usage differ for each codec, please refer to the concerned codec specification to obtain the codec specific information.

See section 4.3.2 of the Bluetooth A2dp specification for SBC codec specific information elements.

See section 4.4.2 of the Bluetooth A2dp specification for MPEG-1,2 Audio codec specific information elements.

See section 4.5.2 of the Bluetooth A2dp specification for MPEG-2, 4 AAC codec specific information elements.

See section 4.6.2 of the Bluetooth A2dp specification for ATRAC family codec specific information elements.

See section 4.7.2 of the Bluetooth A2dp specification for Vendor Specific A2DP codec specific information elements.

<br />

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

### getCodecSpecific2

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

```
public long getCodecSpecific2 ()
```

Returns the codec specific value2. As the value and usage differ for each codec, please refer to the concerned codec specification to obtain the codec specific information.

See section 4.3.2 of the Bluetooth A2dp specification for SBC codec specific information elements.

See section 4.4.2 of the Bluetooth A2dp specification for MPEG-1,2 Audio codec specific information elements.

See section 4.5.2 of the Bluetooth A2dp specification for MPEG-2, 4 AAC codec specific information elements.

See section 4.6.2 of the Bluetooth A2dp specification for ATRAC family codec specific information elements.

See section 4.7.2 of the Bluetooth A2dp specification for Vendor Specific A2DP codec specific information elements.

<br />

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

### getCodecSpecific3

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

```
public long getCodecSpecific3 ()
```

Returns the codec specific value3. As the value and usage differ for each codec, please refer to the concerned codec specification to obtain the codec specific information.

See section 4.3.2 of the Bluetooth A2dp specification for SBC codec specific information elements.

See section 4.4.2 of the Bluetooth A2dp specification for MPEG-1,2 Audio codec specific information elements.

See section 4.5.2 of the Bluetooth A2dp specification for MPEG-2, 4 AAC codec specific information elements.

See section 4.6.2 of the Bluetooth A2dp specification for ATRAC family codec specific information elements.

See section 4.7.2 of the Bluetooth A2dp specification for Vendor Specific A2DP codec specific information elements.

<br />

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

### getCodecSpecific4

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

```
public long getCodecSpecific4 ()
```

Returns the codec specific value4. As the value and usage differ for each codec, please refer to the concerned codec specification to obtain the codec specific information.

See section 4.3.2 of the Bluetooth A2dp specification for SBC codec specific information elements.

See section 4.4.2 of the Bluetooth A2dp specification for MPEG-1,2 Audio codec specific information elements.

See section 4.5.2 of the Bluetooth A2dp specification for MPEG-2, 4 AAC codec specific information elements.

See section 4.6.2 of the Bluetooth A2dp specification for ATRAC family codec specific information elements.

See section 4.7.2 of the Bluetooth A2dp specification for Vendor Specific A2DP codec specific information elements.

<br />

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

### getCodecType

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

```
public int getCodecType ()
```

<br />

**This method was deprecated in API level 35.**   
use[BluetoothCodecConfig.getExtendedCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#getExtendedCodecType())instead.

Returns the source codec type of this config.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[SOURCE_CODEC_TYPE_SBC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_SBC),[SOURCE_CODEC_TYPE_AAC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_AAC),[SOURCE_CODEC_TYPE_APTX](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_APTX),[SOURCE_CODEC_TYPE_APTX_HD](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_APTX_HD),[SOURCE_CODEC_TYPE_LDAC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_LDAC),[SOURCE_CODEC_TYPE_LC3](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_LC3),[SOURCE_CODEC_TYPE_OPUS](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_OPUS), or[SOURCE_CODEC_TYPE_INVALID](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_INVALID) <br /> |

### getExtendedCodecType

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

```
public BluetoothCodecType getExtendedCodecType ()
```

Returns the source codec type of this config.

<br />

|                                                               Returns                                                               ||
|----------------------------------------------------------------------------------------------------|---------------------------------|
| [BluetoothCodecType](https://developer.android.com/reference/android/bluetooth/BluetoothCodecType) | This value may be`null`. <br /> |

### getSampleRate

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

```
public int getSampleRate ()
```

Returns the codec sample rate. The value can be a bitmask with all supported sample rates.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                       Returns                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[SAMPLE_RATE_NONE](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_NONE),[SAMPLE_RATE_44100](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_44100),[SAMPLE_RATE_48000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_48000),[SAMPLE_RATE_88200](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_88200),[SAMPLE_RATE_96000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_96000),[SAMPLE_RATE_176400](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_176400), or[SAMPLE_RATE_192000](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SAMPLE_RATE_192000) <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash representation of this BluetoothCodecConfig based on all the config values.

<br />

|                     Returns                      ||
|-------|-------------------------------------------|
| `int` | a hash code value for this object. <br /> |

### isMandatoryCodec

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

```
public boolean isMandatoryCodec ()
```

Checks whether the codec is mandatory.

The actual mandatory codec type for Android Bluetooth audio is SBC. See[SOURCE_CODEC_TYPE_SBC](https://developer.android.com/reference/android/bluetooth/BluetoothCodecConfig#SOURCE_CODEC_TYPE_SBC).

<br />

|                              Returns                               ||
|-----------|---------------------------------------------------------|
| `boolean` | `true`if the codec is mandatory,`false`otherwise <br /> |

### toString

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

```
public String toString ()
```

Returns a[String](https://developer.android.com/reference/java/lang/String)that describes each BluetoothCodecConfig parameter current value.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |