1/* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit ConnectivityKit 19 */ 20 21import type { AsyncCallback } from './@ohos.base'; 22import type baseProfile from './@ohos.bluetooth.baseProfile'; 23 24/** 25 * Provides methods to accessing bluetooth audio related capabilities. 26 * 27 * @namespace a2dp 28 * @syscap SystemCapability.Communication.Bluetooth.Core 29 * @since 10 30 */ 31declare namespace a2dp { 32 /** 33 * Base interface of profile. 34 * 35 * @typedef { baseProfile.BaseProfile } BaseProfile 36 * @syscap SystemCapability.Communication.Bluetooth.Core 37 * @since 10 38 */ 39 type BaseProfile = baseProfile.BaseProfile; 40 41 /** 42 * create the instance of a2dp profile. 43 * 44 * @returns { A2dpSourceProfile } Returns the instance of profile. 45 * @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified. 46 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 47 * @throws { BusinessError } 801 - Capability not supported. 48 * @syscap SystemCapability.Communication.Bluetooth.Core 49 * @since 10 50 */ 51 function createA2dpSrcProfile(): A2dpSourceProfile; 52 53 /** 54 * Manager a2dp source profile. 55 * 56 * @typedef A2dpSourceProfile 57 * @syscap SystemCapability.Communication.Bluetooth.Core 58 * @since 10 59 */ 60 interface A2dpSourceProfile extends BaseProfile { 61 /** 62 * Initiate an A2DP connection to a remote device. 63 * 64 * @permission ohos.permission.ACCESS_BLUETOOTH 65 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 66 * @throws { BusinessError } 201 - Permission denied. 67 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 68 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 69 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 70 * @throws { BusinessError } 801 - Capability not supported. 71 * @throws { BusinessError } 2900001 - Service stopped. 72 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 73 * @throws { BusinessError } 2900004 - Profile is not supported. 74 * @throws { BusinessError } 2900099 - Operation failed. 75 * @syscap SystemCapability.Communication.Bluetooth.Core 76 * @systemapi 77 * @since 10 78 */ 79 connect(deviceId: string): void; 80 81 /** 82 * Disconnect the A2DP connection with the remote device. 83 * 84 * @permission ohos.permission.ACCESS_BLUETOOTH 85 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 86 * @throws { BusinessError } 201 - Permission denied. 87 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 88 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 89 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 90 * @throws { BusinessError } 801 - Capability not supported. 91 * @throws { BusinessError } 2900001 - Service stopped. 92 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 93 * @throws { BusinessError } 2900004 - Profile is not supported. 94 * @throws { BusinessError } 2900099 - Operation failed. 95 * @syscap SystemCapability.Communication.Bluetooth.Core 96 * @systemapi 97 * @since 10 98 */ 99 disconnect(deviceId: string): void; 100 101 /** 102 * Obtains the playing state of device. 103 * 104 * @permission ohos.permission.ACCESS_BLUETOOTH 105 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 106 * @returns { PlayingState } Returns the playing state. 107 * @throws { BusinessError } 201 - Permission denied. 108 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 109 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 110 * @throws { BusinessError } 801 - Capability not supported. 111 * @throws { BusinessError } 2900001 - Service stopped. 112 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 113 * @throws { BusinessError } 2900004 - Profile is not supported. 114 * @throws { BusinessError } 2900099 - Operation failed. 115 * @syscap SystemCapability.Communication.Bluetooth.Core 116 * @since 10 117 */ 118 getPlayingState(deviceId: string): PlayingState; 119 120 /** 121 * Checks whether the device supports absolute volume. 122 * 123 * @permission ohos.permission.ACCESS_BLUETOOTH 124 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 125 * @returns { Promise<boolean> } Returns the promise object. 126 * @throws { BusinessError } 201 - Permission denied. 127 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 128 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 129 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 130 * @throws { BusinessError } 801 - Capability not supported. 131 * @throws { BusinessError } 2900001 - Service stopped. 132 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 133 * @throws { BusinessError } 2900099 - Operation failed. 134 * @syscap SystemCapability.Communication.Bluetooth.Core 135 * @systemapi 136 * @since 11 137 */ 138 isAbsoluteVolumeSupported(deviceId: string): Promise<boolean>; 139 140 /** 141 * Checks whether the device supports absolute volume. 142 * 143 * @permission ohos.permission.ACCESS_BLUETOOTH 144 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 145 * @param { AsyncCallback<boolean> } callback - Callback used to listen for the pairing request event. 146 * @throws { BusinessError } 201 - Permission denied. 147 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 148 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 149 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 150 * @throws { BusinessError } 801 - Capability not supported. 151 * @throws { BusinessError } 2900001 - Service stopped. 152 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 153 * @throws { BusinessError } 2900099 - Operation failed. 154 * @syscap SystemCapability.Communication.Bluetooth.Core 155 * @systemapi 156 * @since 11 157 */ 158 isAbsoluteVolumeSupported(deviceId: string, callback: AsyncCallback<boolean>): void; 159 160 /** 161 * Checks whether the absolute volume is enabled. 162 * 163 * @permission ohos.permission.ACCESS_BLUETOOTH 164 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 165 * @returns { Promise<boolean> } Returns the promise object. 166 * @throws { BusinessError } 201 - Permission denied. 167 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 168 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 169 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 170 * @throws { BusinessError } 801 - Capability not supported. 171 * @throws { BusinessError } 2900001 - Service stopped. 172 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 173 * @throws { BusinessError } 2900099 - Operation failed. 174 * @syscap SystemCapability.Communication.Bluetooth.Core 175 * @systemapi 176 * @since 11 177 */ 178 isAbsoluteVolumeEnabled(deviceId: string): Promise<boolean>; 179 180 /** 181 * Checks whether the absolute volume is enabled. 182 * 183 * @permission ohos.permission.ACCESS_BLUETOOTH 184 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 185 * @param { AsyncCallback<boolean> } callback - the callback result. 186 * @throws { BusinessError } 201 - Permission denied. 187 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 188 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 189 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 190 * @throws { BusinessError } 801 - Capability not supported. 191 * @throws { BusinessError } 2900001 - Service stopped. 192 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 193 * @throws { BusinessError } 2900099 - Operation failed. 194 * @syscap SystemCapability.Communication.Bluetooth.Core 195 * @systemapi 196 * @since 11 197 */ 198 isAbsoluteVolumeEnabled(deviceId: string, callback: AsyncCallback<boolean>): void; 199 200 /** 201 * Turn on the absolute volume switch. 202 * 203 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 204 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 205 * @returns { Promise<void> } Returns the promise object. 206 * @throws { BusinessError } 201 - Permission denied. 207 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 208 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 209 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 210 * @throws { BusinessError } 801 - Capability not supported. 211 * @throws { BusinessError } 2900001 - Service stopped. 212 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 213 * @throws { BusinessError } 2900099 - Operation failed. 214 * @syscap SystemCapability.Communication.Bluetooth.Core 215 * @systemapi 216 * @since 11 217 */ 218 enableAbsoluteVolume(deviceId: string): Promise<void>; 219 220 /** 221 * Turn on the absolute volume switch.. 222 * 223 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 224 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 225 * @param { AsyncCallback<void> } callback - the callback result. 226 * @throws { BusinessError } 201 - Permission denied. 227 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 228 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 229 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 230 * @throws { BusinessError } 801 - Capability not supported. 231 * @throws { BusinessError } 2900001 - Service stopped. 232 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 233 * @throws { BusinessError } 2900099 - Operation failed. 234 * @syscap SystemCapability.Communication.Bluetooth.Core 235 * @systemapi 236 * @since 11 237 */ 238 enableAbsoluteVolume(deviceId: string, callback: AsyncCallback<void>): void; 239 240 /** 241 * Turn off the absolute volume switch. 242 * 243 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 244 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 245 * @returns { Promise<void> } Returns the promise object. 246 * @throws { BusinessError } 201 - Permission denied. 247 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 248 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 249 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 250 * @throws { BusinessError } 801 - Capability not supported. 251 * @throws { BusinessError } 2900001 - Service stopped. 252 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 253 * @throws { BusinessError } 2900099 - Operation failed. 254 * @syscap SystemCapability.Communication.Bluetooth.Core 255 * @systemapi 256 * @since 11 257 */ 258 disableAbsoluteVolume(deviceId: string): Promise<void>; 259 260 /** 261 * Turn off the absolute volume switch.. 262 * 263 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 264 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 265 * @param { AsyncCallback<void> } callback - the callback result. 266 * @throws { BusinessError } 201 - Permission denied. 267 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 268 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 269 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 270 * @throws { BusinessError } 801 - Capability not supported. 271 * @throws { BusinessError } 2900001 - Service stopped. 272 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 273 * @throws { BusinessError } 2900099 - Operation failed. 274 * @syscap SystemCapability.Communication.Bluetooth.Core 275 * @systemapi 276 * @since 11 277 */ 278 disableAbsoluteVolume(deviceId: string, callback: AsyncCallback<void>): void; 279 280 /** 281 * Get codec information. 282 * 283 * @permission ohos.permission.ACCESS_BLUETOOTH 284 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 285 * @returns { CodecInfo } Returns the CodecInfo. 286 * @throws { BusinessError } 201 - Permission denied. 287 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 288 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 289 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 290 * @throws { BusinessError } 801 - Capability not supported. 291 * @throws { BusinessError } 2900001 - Service stopped. 292 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 293 * @throws { BusinessError } 2900099 - Operation failed. 294 * @syscap SystemCapability.Communication.Bluetooth.Core 295 * @systemapi 296 * @since 11 297 */ 298 getCurrentCodecInfo(deviceId: string): CodecInfo; 299 300 /** 301 * Set codec information. 302 * 303 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 304 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 305 * @param { CodecInfo } codecInfo - Indicates the CodecInfo. 306 * @throws { BusinessError } 201 - Permission denied. 307 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 308 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 309 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 310 * @throws { BusinessError } 801 - Capability not supported. 311 * @throws { BusinessError } 2900001 - Service stopped. 312 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 313 * @throws { BusinessError } 2900099 - Operation failed. 314 * @syscap SystemCapability.Communication.Bluetooth.Core 315 * @systemapi 316 * @since 11 317 */ 318 setCurrentCodecInfo(deviceId: string, codecInfo: CodecInfo): void; 319 320 /** 321 * Restriction devices to play music within {@code duration} milliseconds of connection. 322 * 323 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 324 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 325 * @param { number } duration - Restricted duration <milliseconds>. Valid range is from 3000ms to 20000ms. 326 * @returns { Promise<void> } Returns the promise object. 327 * @throws { BusinessError } 201 - Permission denied. 328 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 329 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 330 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 331 * @throws { BusinessError } 801 - Capability not supported. 332 * @throws { BusinessError } 2900001 - Service stopped. 333 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 334 * @throws { BusinessError } 2900099 - Operation failed. 335 * @syscap SystemCapability.Communication.Bluetooth.Core 336 * @systemapi 337 * @since 12 338 */ 339 disableAutoPlay(deviceId: string, duration: number): Promise<void>; 340 341 /** 342 * Allow devices to automatically play music when connected. 343 * 344 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 345 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 346 * @returns { Promise<void> } Returns the promise object. 347 * @throws { BusinessError } 201 - Permission denied. 348 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 349 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 350 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 351 * @throws { BusinessError } 801 - Capability not supported. 352 * @throws { BusinessError } 2900001 - Service stopped. 353 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 354 * @throws { BusinessError } 2900099 - Operation failed. 355 * @syscap SystemCapability.Communication.Bluetooth.Core 356 * @systemapi 357 * @since 12 358 */ 359 enableAutoPlay(deviceId: string): Promise<void>; 360 361 /** 362 * Obtains the duration for which automatic playback is disabled. 363 * 364 * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH 365 * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". 366 * @returns { Promise<number> } Returns the duration <milliseconds>; 367 * If returns { @code -1 } means allow devices automatic play music when connected. 368 * @throws { BusinessError } 201 - Permission denied. 369 * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs. 370 * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. 371 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 372 * @throws { BusinessError } 801 - Capability not supported. 373 * @throws { BusinessError } 2900001 - Service stopped. 374 * @throws { BusinessError } 2900003 - Bluetooth switch is off. 375 * @throws { BusinessError } 2900099 - Operation failed. 376 * @syscap SystemCapability.Communication.Bluetooth.Core 377 * @systemapi 378 * @since 12 379 */ 380 getAutoPlayDisabledDuration(deviceId: string): Promise<number>; 381 } 382 383 /** 384 * Describes the codec information. 385 * 386 * @typedef CodecInfo 387 * @syscap SystemCapability.Communication.Bluetooth.Core 388 * @since 11 389 */ 390 interface CodecInfo { 391 /** 392 * codec type 393 * 394 * @syscap SystemCapability.Communication.Bluetooth.Core 395 * @since 11 396 */ 397 codecType: CodecType; 398 /** 399 * codec bits per sample. 400 * 401 * @syscap SystemCapability.Communication.Bluetooth.Core 402 * @since 11 403 */ 404 codecBitsPerSample: CodecBitsPerSample; 405 /** 406 * codec channel mode. 407 * 408 * @syscap SystemCapability.Communication.Bluetooth.Core 409 * @since 11 410 */ 411 codecChannelMode: CodecChannelMode; 412 /** 413 * codec sample rate. 414 * 415 * @syscap SystemCapability.Communication.Bluetooth.Core 416 * @since 11 417 */ 418 codecSampleRate: CodecSampleRate; 419 } 420 421 /** 422 * The enum of a2dp playing state. 423 * 424 * @enum { number } 425 * @syscap SystemCapability.Communication.Bluetooth.Core 426 * @since 10 427 */ 428 enum PlayingState { 429 /** 430 * Not playing. 431 * 432 * @syscap SystemCapability.Communication.Bluetooth.Core 433 * @since 10 434 */ 435 STATE_NOT_PLAYING, 436 /** 437 * Playing. 438 * 439 * @syscap SystemCapability.Communication.Bluetooth.Core 440 * @since 10 441 */ 442 STATE_PLAYING 443 } 444 445 /** 446 * Describes the codec type. 447 * 448 * @enum { number } 449 * @syscap SystemCapability.Communication.Bluetooth.Core 450 * @since 11 451 */ 452 enum CodecType { 453 /** 454 * invalid codec type. 455 * 456 * @syscap SystemCapability.Communication.Bluetooth.Core 457 * @since 11 458 */ 459 CODEC_TYPE_INVALID = -1, 460 /** 461 * SBC - Sub-band coding. 462 * 463 * @syscap SystemCapability.Communication.Bluetooth.Core 464 * @since 11 465 */ 466 CODEC_TYPE_SBC = 0, 467 /** 468 * AAC -Advanced Audio Coding. 469 * 470 * @syscap SystemCapability.Communication.Bluetooth.Core 471 * @since 11 472 */ 473 CODEC_TYPE_AAC = 1, 474 /** 475 * L2HC. 476 * 477 * @syscap SystemCapability.Communication.Bluetooth.Core 478 * @since 11 479 */ 480 CODEC_TYPE_L2HC = 2 481 } 482 483 /** 484 * Describes the codec channel mode. 485 * 486 * @enum { number } 487 * @syscap SystemCapability.Communication.Bluetooth.Core 488 * @since 11 489 */ 490 enum CodecChannelMode { 491 /** 492 * Codec channel mode none. 493 * 494 * @syscap SystemCapability.Communication.Bluetooth.Core 495 * @since 11 496 */ 497 CODEC_CHANNEL_MODE_NONE = 0, 498 /** 499 * Codec channel mode MONO. 500 * 501 * @syscap SystemCapability.Communication.Bluetooth.Core 502 * @since 11 503 */ 504 CODEC_CHANNEL_MODE_MONO = 1, 505 /** 506 * Codec channel mode STEREO. 507 * 508 * @syscap SystemCapability.Communication.Bluetooth.Core 509 * @since 11 510 */ 511 CODEC_CHANNEL_MODE_STEREO = 2 512 } 513 514 /** 515 * Describes the codec bits per sample. 516 * 517 * @enum { number } 518 * @syscap SystemCapability.Communication.Bluetooth.Core 519 * @since 11 520 */ 521 enum CodecBitsPerSample { 522 /** 523 * Codec bits per sample none. 524 * 525 * @syscap SystemCapability.Communication.Bluetooth.Core 526 * @since 11 527 */ 528 CODEC_BITS_PER_SAMPLE_NONE = 0, 529 /** 530 * Codec 16 bits per sample. 531 * 532 * @syscap SystemCapability.Communication.Bluetooth.Core 533 * @since 11 534 */ 535 CODEC_BITS_PER_SAMPLE_16 = 1, 536 /** 537 * Codec 24 bits per sample. 538 * 539 * @syscap SystemCapability.Communication.Bluetooth.Core 540 * @since 11 541 */ 542 CODEC_BITS_PER_SAMPLE_24 = 2, 543 /** 544 * Codec 32 bits per sample. 545 * 546 * @syscap SystemCapability.Communication.Bluetooth.Core 547 * @since 11 548 */ 549 CODEC_BITS_PER_SAMPLE_32 = 3 550 } 551 552 /** 553 * Describes the codec sample rate. 554 * 555 * @enum { number } 556 * @syscap SystemCapability.Communication.Bluetooth.Core 557 * @since 11 558 */ 559 enum CodecSampleRate { 560 /** 561 * Codec sample rate none. 562 * 563 * @syscap SystemCapability.Communication.Bluetooth.Core 564 * @since 11 565 */ 566 CODEC_SAMPLE_RATE_NONE = 0, 567 /** 568 * Codec sample rate 44.1k. 569 * 570 * @syscap SystemCapability.Communication.Bluetooth.Core 571 * @since 11 572 */ 573 CODEC_SAMPLE_RATE_44100 = 1, 574 /** 575 * Codec sample rate 48k. 576 * 577 * @syscap SystemCapability.Communication.Bluetooth.Core 578 * @since 11 579 */ 580 CODEC_SAMPLE_RATE_48000 = 2, 581 /** 582 * Codec sample rate 88.2k. 583 * 584 * @syscap SystemCapability.Communication.Bluetooth.Core 585 * @since 11 586 */ 587 CODEC_SAMPLE_RATE_88200 = 3, 588 /** 589 * Codec sample rate 96k. 590 * 591 * @syscap SystemCapability.Communication.Bluetooth.Core 592 * @since 11 593 */ 594 CODEC_SAMPLE_RATE_96000 = 4, 595 /** 596 * Codec sample rate 176.4k. 597 * 598 * @syscap SystemCapability.Communication.Bluetooth.Core 599 * @since 11 600 */ 601 CODEC_SAMPLE_RATE_176400 = 5, 602 /** 603 * Codec sample rate 192k. 604 * 605 * @syscap SystemCapability.Communication.Bluetooth.Core 606 * @since 11 607 */ 608 CODEC_SAMPLE_RATE_192000 = 6 609 } 610} 611 612export default a2dp;