BluetoothCodecConfig.Builder


public static final class BluetoothCodecConfig.Builder
extends Object

java.lang.Object
   ↳ android.bluetooth.BluetoothCodecConfig.Builder


Builder for BluetoothCodecConfig.

By default, the codec type will be set to BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID, the codec priority to BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT, the sample rate to BluetoothCodecConfig.SAMPLE_RATE_NONE, the bits per sample to BluetoothCodecConfig.BITS_PER_SAMPLE_NONE, the channel mode to BluetoothCodecConfig.CHANNEL_MODE_NONE, and all the codec specific values to 0.

Summary

Public constructors

Builder()

Public methods

BluetoothCodecConfig build()

Build BluetoothCodecConfig.

BluetoothCodecConfig.Builder setBitsPerSample(int bitsPerSample)

Set the bits per sample for Bluetooth codec config.

BluetoothCodecConfig.Builder setChannelMode(int channelMode)

Set the channel mode for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecPriority(int codecPriority)

Set codec priority for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific1(long codecSpecific1)

Set the first codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific2(long codecSpecific2)

Set the second codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific3(long codecSpecific3)

Set the third codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific4(long codecSpecific4)

Set the fourth codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecType(int codecType)

This method was deprecated in API level 35. use BluetoothCodecType instead

BluetoothCodecConfig.Builder setExtendedCodecType(BluetoothCodecType codecType)

Set codec type for Bluetooth codec config.

BluetoothCodecConfig.Builder setSampleRate(int sampleRate)

Set sample rate for Bluetooth codec config.

Inherited methods

Public constructors

Builder

Added in API level 33
public Builder ()

Public methods

build

Added in API level 33
public BluetoothCodecConfig build ()

Build BluetoothCodecConfig.

Returns
BluetoothCodecConfig new BluetoothCodecConfig built This value cannot be null.

setBitsPerSample

Added in API level 33
public BluetoothCodecConfig.Builder setBitsPerSample (int bitsPerSample)

Set the bits per sample for Bluetooth codec config.

Parameters
bitsPerSample int: of this codec Value is BluetoothCodecConfig.BITS_PER_SAMPLE_NONE, BluetoothCodecConfig.BITS_PER_SAMPLE_16, BluetoothCodecConfig.BITS_PER_SAMPLE_24, or BluetoothCodecConfig.BITS_PER_SAMPLE_32

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setChannelMode

Added in API level 33
public BluetoothCodecConfig.Builder setChannelMode (int channelMode)

Set the channel mode for Bluetooth codec config.

Parameters
channelMode int: of this codec Value is BluetoothCodecConfig.CHANNEL_MODE_NONE, BluetoothCodecConfig.CHANNEL_MODE_MONO, or BluetoothCodecConfig.CHANNEL_MODE_STEREO

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecPriority

Added in API level 33
public BluetoothCodecConfig.Builder setCodecPriority (int codecPriority)

Set codec priority for Bluetooth codec config.

Parameters
codecPriority int: of this codec Value is BluetoothCodecConfig.CODEC_PRIORITY_DISABLED, BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT, or BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific1

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific1 (long codecSpecific1)

Set the first codec specific values for Bluetooth codec config.

Parameters
codecSpecific1 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific2

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific2 (long codecSpecific2)

Set the second codec specific values for Bluetooth codec config.

Parameters
codecSpecific2 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific3

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific3 (long codecSpecific3)

Set the third codec specific values for Bluetooth codec config.

Parameters
codecSpecific3 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific4

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific4 (long codecSpecific4)

Set the fourth codec specific values for Bluetooth codec config.

Parameters
codecSpecific4 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecType

Added in API level 33
Deprecated in API level 35
public BluetoothCodecConfig.Builder setCodecType (int codecType)

This method was deprecated in API level 35.
use BluetoothCodecType instead

Set codec type for Bluetooth codec config.

Parameters
codecType int: of this codec Value is BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC, BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3, BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, or BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setExtendedCodecType

Added in API level 35
public BluetoothCodecConfig.Builder setExtendedCodecType (BluetoothCodecType codecType)

Set codec type for Bluetooth codec config.

Parameters
codecType BluetoothCodecType: of this codec This value may be null.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setSampleRate

Added in API level 33
public BluetoothCodecConfig.Builder setSampleRate (int sampleRate)

Set sample rate for Bluetooth codec config.

Parameters
sampleRate int: of this codec Value is BluetoothCodecConfig.SAMPLE_RATE_NONE, BluetoothCodecConfig.SAMPLE_RATE_44100, BluetoothCodecConfig.SAMPLE_RATE_48000, BluetoothCodecConfig.SAMPLE_RATE_88200, BluetoothCodecConfig.SAMPLE_RATE_96000, BluetoothCodecConfig.SAMPLE_RATE_176400, or BluetoothCodecConfig.SAMPLE_RATE_192000

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.