Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#inhmethods)

# BluetoothLeAudioCodecConfig.Builder

*** ** * ** ***


`
public
static
final

class
BluetoothLeAudioCodecConfig.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig`.

By default, the codec type will be set to `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_INVALID`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#Builder()() ` |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#Builder(android.bluetooth.BluetoothLeAudioCodecConfig)(https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig config) ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#build()() ` Build `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig`. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setBitsPerSample(int)(int bitsPerSample) ` Set the bits per sample for LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setChannelCount(int)(int channelCount) ` Set the channel count for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setCodecId(long)(long codecId) ` Sets the codec ID. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setCodecPriority(int)(int codecPriority) ` Set codec priority for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setCodecType(int)(int codecType) ` Set codec type for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setFrameDuration(int)(int frameDuration) ` Set the frame duration for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setMaxOctetsPerFrame(int)(int maxOctetsPerFrame) ` Set the maximum octets per frame for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setMinOctetsPerFrame(int)(int minOctetsPerFrame) ` Set the minimum octets per frame for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setOctetsPerFrame(int)(int octetsPerFrame) ` Set the octets per frame for Bluetooth LE audio codec config. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | ` https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder#setSampleRate(int)(int sampleRate) ` Set sample rate for Bluetooth LE audio codec config. |

| ### 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*. | ||

## Public constructors

### Builder

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

```
public Builder ()
```

<br />

<br />

### Builder

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

```
public Builder (BluetoothLeAudioCodecConfig config)
```

<br />

<br />

| Parameters ||
|---|---|
| `config` | `BluetoothLeAudioCodecConfig`: This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public BluetoothLeAudioCodecConfig build ()
```

Build `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig` | new BluetoothLeAudioCodecConfig built. This value cannot be `null`. <br /> |

### setBitsPerSample

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

```
public BluetoothLeAudioCodecConfig.Builder setBitsPerSample (int bitsPerSample)
```

Set the bits per sample for LE audio codec config.

<br />

| Parameters ||
|---|---|
| `bitsPerSample` | `int`: of this codec. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#BITS_PER_SAMPLE_NONE` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#BITS_PER_SAMPLE_16` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#BITS_PER_SAMPLE_24` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#BITS_PER_SAMPLE_32` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setChannelCount

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

```
public BluetoothLeAudioCodecConfig.Builder setChannelCount (int channelCount)
```

Set the channel count for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `channelCount` | `int`: of this codec. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CHANNEL_COUNT_NONE` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CHANNEL_COUNT_1` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CHANNEL_COUNT_2` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setCodecId

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

```
public BluetoothLeAudioCodecConfig.Builder setCodecId (long codecId)
```

Sets the codec ID.

The codec identifier is 40 bits as defined by Bluetooth ASCS v1.0.1.

Currently, only the following Codec IDs are supported:

- **LC3:** 0x00_0000000006
- **Vendor Specific:** 0xNN_NNNNNNNNFF

<br />

<br />

| Parameters ||
|---|---|
| `codecId` | `long`: The 40-bit codec identifier. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the codecId is greater than 40 bits, or not supported (not LC3 or Vendor Specific). |

### setCodecPriority

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

```
public BluetoothLeAudioCodecConfig.Builder setCodecPriority (int codecPriority)
```

Set codec priority for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `codecPriority` | `int`: of this codec. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CODEC_PRIORITY_DISABLED` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CODEC_PRIORITY_DEFAULT` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#CODEC_PRIORITY_HIGHEST` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setCodecType

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

```
public BluetoothLeAudioCodecConfig.Builder setCodecType (int codecType)
```

Set codec type for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `codecType` | `int`: of this codec. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_LC3` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_OPUS` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_OPUS_HI_RES` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_VENDOR_SPECIFIC` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SOURCE_CODEC_TYPE_INVALID` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setFrameDuration

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

```
public BluetoothLeAudioCodecConfig.Builder setFrameDuration (int frameDuration)
```

Set the frame duration for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `frameDuration` | `int`: of this codec. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#FRAME_DURATION_NONE` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#FRAME_DURATION_7500` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#FRAME_DURATION_10000` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setMaxOctetsPerFrame

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

```
public BluetoothLeAudioCodecConfig.Builder setMaxOctetsPerFrame (int maxOctetsPerFrame)
```

Set the maximum octets per frame for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `maxOctetsPerFrame` | `int`: of this codec <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setMinOctetsPerFrame

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

```
public BluetoothLeAudioCodecConfig.Builder setMinOctetsPerFrame (int minOctetsPerFrame)
```

Set the minimum octets per frame for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `minOctetsPerFrame` | `int`: of this codec <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setOctetsPerFrame

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

```
public BluetoothLeAudioCodecConfig.Builder setOctetsPerFrame (int octetsPerFrame)
```

Set the octets per frame for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `octetsPerFrame` | `int`: of this codec <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |

### setSampleRate

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

```
public BluetoothLeAudioCodecConfig.Builder setSampleRate (int sampleRate)
```

Set sample rate for Bluetooth LE audio codec config.

<br />

| Parameters ||
|---|---|
| `sampleRate` | `int`: of this codec. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_NONE` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_8000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_11025` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_16000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_22050` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_24000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_32000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_44100` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_48000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_88200` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_96000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_176400` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_192000` - `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig#SAMPLE_RATE_384000` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothLeAudioCodecConfig.Builder` | the same Builder instance. This value cannot be `null`. <br /> |