Added in API level 33

Builder


class Builder
kotlin.Any
   ↳ android.bluetooth.BluetoothLeAudioCodecConfig.Builder

Builder for BluetoothLeAudioCodecConfig.

By default, the codec type will be set to BluetoothLeAudioCodecConfig.SOURCE_CODEC_TYPE_INVALID

Summary

Public constructors

Public methods
BluetoothLeAudioCodecConfig

Build BluetoothLeAudioCodecConfig.

BluetoothLeAudioCodecConfig.Builder
setBitsPerSample(bitsPerSample: Int)

Set the bits per sample for LE audio codec config.

BluetoothLeAudioCodecConfig.Builder
setChannelCount(channelCount: Int)

Set the channel count for Bluetooth LE audio codec config.

BluetoothLeAudioCodecConfig.Builder
setCodecId(codecId: Long)

Sets the codec ID.

BluetoothLeAudioCodecConfig.Builder
setCodecPriority(codecPriority: Int)

Set codec priority for Bluetooth LE audio codec config.

BluetoothLeAudioCodecConfig.Builder
setCodecType(codecType: Int)

Set codec type for Bluetooth LE audio codec config.

BluetoothLeAudioCodecConfig.Builder
setFrameDuration(frameDuration: Int)

Set the frame duration for Bluetooth LE audio codec config.

BluetoothLeAudioCodecConfig.Builder
setMaxOctetsPerFrame(maxOctetsPerFrame: Int)

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

BluetoothLeAudioCodecConfig.Builder
setMinOctetsPerFrame(minOctetsPerFrame: Int)

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

BluetoothLeAudioCodecConfig.Builder
setOctetsPerFrame(octetsPerFrame: Int)

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

BluetoothLeAudioCodecConfig.Builder
setSampleRate(sampleRate: Int)

Set sample rate for Bluetooth LE audio codec config.

Public constructors

Builder

Added in API level 33
Builder()

Builder

Added in API level 33
Builder(config: BluetoothLeAudioCodecConfig)
Parameters
config BluetoothLeAudioCodecConfig: This value cannot be null.

Public methods

build

Added in API level 33
fun build(): BluetoothLeAudioCodecConfig

Build BluetoothLeAudioCodecConfig.

Return
BluetoothLeAudioCodecConfig new BluetoothLeAudioCodecConfig built.
This value cannot be null.

setBitsPerSample

Added in API level 33
fun setBitsPerSample(bitsPerSample: Int): BluetoothLeAudioCodecConfig.Builder

Set the bits per sample for LE audio codec config.

Parameters
bitsPerSample Int: of this codec.
Value is either 0 or a combination of the following:
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setChannelCount

Added in API level 33
fun setChannelCount(channelCount: Int): BluetoothLeAudioCodecConfig.Builder

Set the channel count for Bluetooth LE audio codec config.

Parameters
channelCount Int: of this codec.
Value is either 0 or a combination of the following:
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setCodecId

Added in API level 33
fun setCodecId(codecId: Long): BluetoothLeAudioCodecConfig.Builder

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
Parameters
codecId Long: The 40-bit codec identifier.
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.
Exceptions
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
fun setCodecPriority(codecPriority: Int): BluetoothLeAudioCodecConfig.Builder

Set codec priority for Bluetooth LE audio codec config.

Parameters
codecPriority Int: of this codec.
Value is one of the following:
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setFrameDuration

Added in API level 33
fun setFrameDuration(frameDuration: Int): BluetoothLeAudioCodecConfig.Builder

Set the frame duration for Bluetooth LE audio codec config.

Parameters
frameDuration Int: of this codec.
Value is either 0 or a combination of the following:
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setMaxOctetsPerFrame

Added in API level 33
fun setMaxOctetsPerFrame(maxOctetsPerFrame: Int): BluetoothLeAudioCodecConfig.Builder

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

Parameters
maxOctetsPerFrame Int: of this codec
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setMinOctetsPerFrame

Added in API level 33
fun setMinOctetsPerFrame(minOctetsPerFrame: Int): BluetoothLeAudioCodecConfig.Builder

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

Parameters
minOctetsPerFrame Int: of this codec
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.

setOctetsPerFrame

Added in API level 33
fun setOctetsPerFrame(octetsPerFrame: Int): BluetoothLeAudioCodecConfig.Builder

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

Parameters
octetsPerFrame Int: of this codec
Return
BluetoothLeAudioCodecConfig.Builder the same Builder instance.
This value cannot be null.