BluetoothCodecConfig
class BluetoothCodecConfig : Parcelable
kotlin.Any | |
↳ | android.bluetooth.BluetoothCodecConfig |
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.
Summary
Nested classes | |
---|---|
Builder for |
Constants | |
---|---|
static Int |
Codec bits per sample 16. |
static Int |
Codec bits per sample 24. |
static Int |
Codec bits per sample 32. |
static Int |
Codec bits per sample 0. |
static Int |
Codec channel mode MONO. |
static Int |
Codec channel mode NONE. |
static Int |
Codec channel mode STEREO. |
static Int |
Codec priority default. |
static Int |
Codec priority disabled. |
static Int |
Codec priority highest. |
static Int |
Codec sample rate 176400 Hz. |
static Int |
Codec sample rate 192000 Hz. |
static Int |
Codec sample rate 44100 Hz. |
static Int |
Codec sample rate 48000 Hz. |
static Int |
Codec sample rate 88200 Hz. |
static Int |
Codec sample rate 96000 Hz. |
static Int |
Codec sample rate 0 Hz. |
static Int |
Source codec type AAC. |
static Int |
Source codec type APTX. |
static Int |
Source codec type APTX HD. |
static Int |
Source codec type invalid. |
static Int |
Source codec type LC3. |
static Int |
Source codec type LDAC. |
static Int |
Source codec type Opus. |
static Int |
Source codec type SBC. |
Inherited constants | |
---|---|
Public methods | |
---|---|
Boolean |
Indicates whether some other object is "equal to" this one. |
Int |
Returns the codec bits per sample. |
Int |
Returns the codec channel mode. |
Int |
Returns the codec selection priority. |
Long |
Returns the codec specific value1. |
Long |
Returns the codec specific value2. |
Long |
Returns the codec specific value3. |
Long |
Returns the codec specific value4. |
Int |
Returns the source codec type of this config. |
BluetoothCodecType? |
Returns the source codec type of this config. |
Int |
Returns the codec sample rate. |
Int |
hashCode() Returns a hash representation of this BluetoothCodecConfig based on all the config values. |
Boolean |
Checks whether the codec is mandatory. |
String |
toString() Returns a |
Properties | |
---|---|
static Parcelable.Creator<BluetoothCodecConfig!> |
Constants
BITS_PER_SAMPLE_16
static val BITS_PER_SAMPLE_16: Int
Codec bits per sample 16.
Value: 1
BITS_PER_SAMPLE_24
static val BITS_PER_SAMPLE_24: Int
Codec bits per sample 24.
Value: 2
BITS_PER_SAMPLE_32
static val BITS_PER_SAMPLE_32: Int
Codec bits per sample 32.
Value: 4
BITS_PER_SAMPLE_NONE
static val BITS_PER_SAMPLE_NONE: Int
Codec bits per sample 0. Default value of the codec bits per sample.
Value: 0
CHANNEL_MODE_MONO
static val CHANNEL_MODE_MONO: Int
Codec channel mode MONO.
Value: 1
CHANNEL_MODE_NONE
static val CHANNEL_MODE_NONE: Int
Codec channel mode NONE. Default value of the codec channel mode.
Value: 0
CHANNEL_MODE_STEREO
static val CHANNEL_MODE_STEREO: Int
Codec channel mode STEREO.
Value: 2
CODEC_PRIORITY_DEFAULT
static val CODEC_PRIORITY_DEFAULT: Int
Codec priority default. Default value used for codec priority.
Value: 0
CODEC_PRIORITY_DISABLED
static val CODEC_PRIORITY_DISABLED: Int
Codec priority disabled. Used to indicate that this codec is disabled and should not be used.
Value: -1
CODEC_PRIORITY_HIGHEST
static val CODEC_PRIORITY_HIGHEST: Int
Codec priority highest. Used to indicate the highest priority a codec can have.
Value: 1000000
SAMPLE_RATE_176400
static val SAMPLE_RATE_176400: Int
Codec sample rate 176400 Hz.
Value: 16
SAMPLE_RATE_192000
static val SAMPLE_RATE_192000: Int
Codec sample rate 192000 Hz.
Value: 32
SAMPLE_RATE_44100
static val SAMPLE_RATE_44100: Int
Codec sample rate 44100 Hz.
Value: 1
SAMPLE_RATE_48000
static val SAMPLE_RATE_48000: Int
Codec sample rate 48000 Hz.
Value: 2
SAMPLE_RATE_88200
static val SAMPLE_RATE_88200: Int
Codec sample rate 88200 Hz.
Value: 4
SAMPLE_RATE_96000
static val SAMPLE_RATE_96000: Int
Codec sample rate 96000 Hz.
Value: 8
SAMPLE_RATE_NONE
static val SAMPLE_RATE_NONE: Int
Codec sample rate 0 Hz. Default value used for codec sample rate.
Value: 0
SOURCE_CODEC_TYPE_AAC
static valSOURCE_CODEC_TYPE_AAC: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type AAC.
Value: 1
SOURCE_CODEC_TYPE_APTX
static valSOURCE_CODEC_TYPE_APTX: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type APTX.
Value: 2
SOURCE_CODEC_TYPE_APTX_HD
static valSOURCE_CODEC_TYPE_APTX_HD: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type APTX HD.
Value: 3
SOURCE_CODEC_TYPE_INVALID
static valSOURCE_CODEC_TYPE_INVALID: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type invalid. This is the default value used for codec type.
Value: 1000000
SOURCE_CODEC_TYPE_LC3
static valSOURCE_CODEC_TYPE_LC3: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type LC3.
Value: 5
SOURCE_CODEC_TYPE_LDAC
static valSOURCE_CODEC_TYPE_LDAC: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type LDAC.
Value: 4
SOURCE_CODEC_TYPE_OPUS
static valSOURCE_CODEC_TYPE_OPUS: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type Opus.
Value: 6
SOURCE_CODEC_TYPE_SBC
static valSOURCE_CODEC_TYPE_SBC: Int
Deprecated: Use the BluetoothCodecType
values returned by android.bluetooth.BluetoothA2dp#getSupportedCodecTypes
instead.
Source codec type SBC. This is the mandatory source codec type.
Value: 0
Public methods
equals
fun equals(other: Any?): Boolean
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 returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
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.
Parameters | |
---|---|
obj |
the reference object with which to compare. |
o |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getBitsPerSample
fun getBitsPerSample(): Int
Returns the codec bits per sample. The value can be a bitmask with all bits per sample supported.
getChannelMode
fun getChannelMode(): Int
Returns the codec channel mode. The value can be a bitmask with all supported channel modes.
Return | |
---|---|
Int |
Value is android.bluetooth.BluetoothCodecConfig#CHANNEL_MODE_NONE , android.bluetooth.BluetoothCodecConfig#CHANNEL_MODE_MONO , or android.bluetooth.BluetoothCodecConfig#CHANNEL_MODE_STEREO |
getCodecPriority
fun getCodecPriority(): Int
Returns the codec selection priority.
The codec selection priority is relative to other codecs: larger value means higher priority.
getCodecSpecific1
fun getCodecSpecific1(): Long
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.
getCodecSpecific2
fun getCodecSpecific2(): Long
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.
getCodecSpecific3
fun getCodecSpecific3(): Long
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.
getCodecSpecific4
fun getCodecSpecific4(): Long
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.
getCodecType
fungetCodecType(): Int
Deprecated: use BluetoothCodecConfig#getExtendedCodecType
instead.
Returns the source codec type of this config.
getExtendedCodecType
fun getExtendedCodecType(): BluetoothCodecType?
Returns the source codec type of this config.
Return | |
---|---|
BluetoothCodecType? |
This value may be null . |
getSampleRate
fun getSampleRate(): Int
Returns the codec sample rate. The value can be a bitmask with all supported sample rates.
hashCode
fun hashCode(): Int
Returns a hash representation of this BluetoothCodecConfig based on all the config values.
Return | |
---|---|
Int |
a hash code value for this object. |
isMandatoryCodec
fun isMandatoryCodec(): Boolean
Checks whether the codec is mandatory.
The actual mandatory codec type for Android Bluetooth audio is SBC. See SOURCE_CODEC_TYPE_SBC
.
Return | |
---|---|
Boolean |
true if the codec is mandatory, false otherwise |
toString
fun toString(): String
Returns a String
that describes each BluetoothCodecConfig parameter current value.
Return | |
---|---|
String |
a string representation of the object. |