| NONE_DEVICES_FLAG<sup>9+</sup> | 0 | No flag.<br>This is a system API and cannot be called by third-party applications. |
| NONE_DEVICES_FLAG<sup>9+</sup> | 0 | No device.<br>This is a system API and cannot be called by third-party applications. |
| OUTPUT_DEVICES_FLAG | 1 | Output device.|
| INPUT_DEVICES_FLAG | 2 | Input device.|
| ALL_DEVICES_FLAG | 3 | All devices.|
| DISTRIBUTED_OUTPUT_DEVICES_FLAG<sup>9+</sup> | 4 | Distributed output device.<br>This is a system API and cannot be called by third-party applications. |
| DISTRIBUTED_INPUT_DEVICES_FLAG<sup>9+</sup> | 8 | Distributed input device.<br>This is a system API and cannot be called by third-party applications. |
| ALL_DISTRIBUTED_DEVICES_FLAG<sup>9+</sup> | 12 | Distributed input and output devices.<br>This is a system API and cannot be called by third-party applications. |
| ALL_DISTRIBUTED_DEVICES_FLAG<sup>9+</sup> | 12 | Distributed input and output device.<br>This is a system API and cannot be called by third-party applications. |
## DeviceRole
...
...
@@ -479,12 +502,13 @@ Enumerates the audio stream usage.
Implements audio volume and audio device management. Before calling any API in **AudioManager**, you must use [getAudioManager](#audiogetaudiomanager) to create an **AudioManager** instance.
...
...
@@ -801,7 +827,7 @@ Obtains an **AudioRoutingManager** instance. This API uses an asynchronous callb
Implements audio stream management. Before calling any API of **AudioStreamManager**, you must use **[getStreamManager](#audiogetstreammanager9)** to obtain an **AudioStreamManager** instance.
Implements audio stream management. Before calling any API in **AudioStreamManager**, you must use [getStreamManager](#getstreammanager9) to obtain an **AudioStreamManager** instance.
### getCurrentAudioRendererInfoArray<sup>9+</sup>
...
...
@@ -2674,16 +2793,6 @@ Obtains the information about the current audio renderers. This API uses an asyn
console.info('######### CapturerChange Off is called #########');
```
## AudioRoutingManager<sup>9+</sup>
Implements audio routing management. Before calling any API in **AudioRoutingManager**, you must use [getRoutingManager](#getroutingmanager9) to create an **AudioRoutingManager** instance.
Implements audio routing management. Before calling any API in **AudioRoutingManager**, you must use [getRoutingManager](#getroutingmanager9) to obtain an **AudioRoutingManager** instance.
### getDevices<sup>9+</sup>
...
...
@@ -3064,11 +3107,11 @@ Obtains the audio devices with a specific flag. This API uses an asynchronous ca
| type | string | Yes | Event type. The value **deviceChange** means the device change event, which is triggered when a device connection status change is detected.|
console.info('Select output devices result promise: SUCCESS');
}).catch((err)=>{
console.error(`Result ERROR: ${err}`);
});
});
});
}
```
### selectOutputDeviceByFilter<sup>9+</sup>
...
...
@@ -3263,7 +3400,7 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi
**System API**: This is a system API.
Selects an audio output device based on the filter criteria. Currently, only one output device can be selected. This API uses an asynchronous callback to return the result.
Selects an audio output device based on the filter criteria. Currently, only one output device can be selected. This API uses an asynchronous callback to return the result.
console.info('Select output devices by filter result callback: SUCCESS');}
});
});
});
}
```
### selectOutputDeviceByFilter<sup>9+</sup>
...
...
@@ -3307,7 +3448,7 @@ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: Audi
**System API**: This is a system API.
Selects an audio output device based on the filter criteria. Currently, only one output device can be selected. This API uses a promise to return the result.
Selects an audio output device based on the filter criteria. Currently, only one output device can be selected. This API uses a promise to return the result.
| networkId<sup>9+</sup> | string | Yes | No | ID of the device network.<br>This is a system API and cannot be called by third-party applications.|
| interruptGroupId<sup>9+</sup> | number | Yes | No | ID of the interruption group to which the device belongs.<br>This is a system API and cannot be called by third-party applications.|
| volumeGroupId<sup>9+</sup> | number | Yes | No | ID of the volume group to which the device belongs.<br>This is a system API and cannot be called by third-party applications.|
| Name | Type | Readable | Writable | Description |
| networkId<sup>9+</sup> | string | Yes | No | ID of the device network.<br>This is a system API and cannot be called by third-party applications. |
| interruptGroupId<sup>9+</sup> | number | Yes | No | ID of the interruption group to which the device belongs.<br>This is a system API and cannot be called by third-party applications. |
| volumeGroupId<sup>9+</sup> | number | Yes | No | ID of the volume group to which the device belongs.<br>This is a system API and cannot be called by third-party applications. |
## AudioDeviceDescriptors
...
...
@@ -3529,13 +3677,11 @@ Implements filter criteria. Before calling **selectOutputDeviceByFilter**, you m
| buffer | ArrayBuffer | Yes | Buffer to be written. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned.|
| buffer | ArrayBuffer | Yes | Buffer to be written. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned. |
| Promise\<number> | Promise used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned.|
| Promise\<number> | Promise used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned.|
| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned.|
| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned.|
| type | string | Yes | Event type. The value **interrupt** means the audio interruption event, which is triggered when audio playback is interrupted.|
| callback | Callback<[InterruptEvent](#interruptevent9)> | Yes | Callback used to return the audio interruption event. |
| type | string | Yes | Event type. The value **interrupt** means the audio interruption event, which is triggered when audio playback is interrupted. |
| callback | Callback<[InterruptEvent](#interruptevent9)> | Yes | Callback used to return the audio interruption event. |
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter.|
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number> | Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter. |
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number>| Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame rendering reaches the value of the **frame** parameter.|
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number> | Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame rendering reaches the value of the **frame** parameter. |
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number>| Yes | Callback invoked when the event is triggered. |
| Promise<ArrayBuffer\> | Promise used to return the result. If the operation is successful, the buffer data read is returned; otherwise, an error code is returned.|
| Promise<ArrayBuffer\> | Promise used to return the result. If the operation is successful, the buffer data read is returned; otherwise, an error code is returned.|
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter. |
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number> | Yes | Callback invoked when the event is triggered.|
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter. |
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number>| Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter.|
| type | string | Yes | Event type. The value **markReach** means the mark reached event, which is triggered when the number of frames captured reaches the value of the **frame** parameter. |
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame rendering reaches the value of the **frame** parameter.|
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number> | Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame rendering reaches the value of the **frame** parameter. |
| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. |
| callback | Callback<number>| Yes | Callback invoked when the event is triggered. |
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame capturing reaches the value of the **frame** parameter.|
| type | string | Yes | Event type. The value **periodReach** means the period reached event, which is triggered when the period of frame capturing reaches the value of the **frame** parameter. |
**Example**
```js
audioCapturer.off('periodReach')
```
### on('stateChange')<sup>8+</sup>
...
...
@@ -5168,10 +5236,10 @@ Subscribes to state change events.