提交 045e894a 编写于 作者: G Gloria

Update docs against 16558+16668+16951+16774

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 bd5ccfca
...@@ -684,21 +684,19 @@ Describes the interruption event received by the application when playback is in ...@@ -684,21 +684,19 @@ Describes the interruption event received by the application when playback is in
| forceType | [InterruptForceType](#interruptforcetype9) | Yes | Whether the interruption is taken by the system or to be taken by the application.| | forceType | [InterruptForceType](#interruptforcetype9) | Yes | Whether the interruption is taken by the system or to be taken by the application.|
| hintType | [InterruptHint](#interrupthint) | Yes | Hint provided along the interruption. | | hintType | [InterruptHint](#interrupthint) | Yes | Hint provided along the interruption. |
## VolumeEvent<sup>8+</sup> ## VolumeEvent<sup>9+</sup>
Describes the event received by the application when the volume is changed. Describes the event received by the application when the volume is changed.
**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Audio.Volume **System capability**: SystemCapability.Multimedia.Audio.Volume
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ----------------------------------- | ---- | -------------------------------------------------------- | | ---------- | ----------------------------------- | ---- | -------------------------------------------------------- |
| volumeType | [AudioVolumeType](#audiovolumetype) | Yes | Audio stream type. | | volumeType | [AudioVolumeType](#audiovolumetype) | Yes | Audio stream type. |
| volume | number | Yes | Volume to set. The value range can be obtained by calling **getMinVolume** and **getMaxVolume**.| | volume | number | Yes | Volume to set. The value range can be obtained by calling **getMinVolume** and **getMaxVolume**. |
| updateUi | boolean | Yes | Whether to show the volume change in UI. | | updateUi | boolean | Yes | Whether to show the volume change in UI. |
| volumeGroupId<sup>9+</sup> | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**. | | volumeGroupId | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**.<br>This is a system API. |
| networkId<sup>9+</sup> | string | Yes | Network ID. | | networkId | string | Yes | Network ID.<br>This is a system API. |
## MicStateChangeEvent<sup>9+</sup> ## MicStateChangeEvent<sup>9+</sup>
...@@ -1106,7 +1104,7 @@ Sets the volume for a stream. This API uses an asynchronous callback to return t ...@@ -1106,7 +1104,7 @@ Sets the volume for a stream. This API uses an asynchronous callback to return t
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY **Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
...@@ -1142,7 +1140,7 @@ Sets the volume for a stream. This API uses a promise to return the result. ...@@ -1142,7 +1140,7 @@ Sets the volume for a stream. This API uses a promise to return the result.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY **Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
...@@ -1368,7 +1366,7 @@ Mutes or unmutes a stream. This API uses an asynchronous callback to return the ...@@ -1368,7 +1366,7 @@ Mutes or unmutes a stream. This API uses an asynchronous callback to return the
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**System capability**: SystemCapability.Multimedia.Audio.Volume **System capability**: SystemCapability.Multimedia.Audio.Volume
...@@ -1400,7 +1398,7 @@ Mutes or unmutes a stream. This API uses a promise to return the result. ...@@ -1400,7 +1398,7 @@ Mutes or unmutes a stream. This API uses a promise to return the result.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**System capability**: SystemCapability.Multimedia.Audio.Volume **System capability**: SystemCapability.Multimedia.Audio.Volume
...@@ -1560,7 +1558,7 @@ Sets the ringer mode. This API uses an asynchronous callback to return the resul ...@@ -1560,7 +1558,7 @@ Sets the ringer mode. This API uses an asynchronous callback to return the resul
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY **Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
...@@ -1595,7 +1593,8 @@ Sets the ringer mode. This API uses a promise to return the result. ...@@ -1595,7 +1593,8 @@ Sets the ringer mode. This API uses a promise to return the result.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY **Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
...@@ -1997,13 +1996,13 @@ audioManager.isMicrophoneMute().then((value) => { ...@@ -1997,13 +1996,13 @@ audioManager.isMicrophoneMute().then((value) => {
}); });
``` ```
### on('volumeChange')<sup>(deprecated)</sup> ### on('volumeChange')<sup>9+</sup>
on(type: 'volumeChange', callback: Callback\<VolumeEvent>): void on(type: 'volumeChange', callback: Callback\<VolumeEvent>): void
> **NOTE** > **NOTE**
> >
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [on](#on9) in **AudioVolumeManager**. > You are advised to use [on](#on9) in **AudioVolumeManager**.
Subscribes to system volume change events. Subscribes to system volume change events.
...@@ -2018,7 +2017,7 @@ Currently, when multiple **AudioManager** instances are used in a single process ...@@ -2018,7 +2017,7 @@ Currently, when multiple **AudioManager** instances are used in a single process
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when a system volume change is detected.| | type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when a system volume change is detected.|
| callback | Callback<[VolumeEvent](#volumeevent8)> | Yes | Callback used to return the system volume change event. | | callback | Callback<[VolumeEvent](#volumeevent9)> | Yes | Callback used to return the system volume change event. |
**Example** **Example**
...@@ -2116,7 +2115,7 @@ audioManager.off('deviceChange', (deviceChanged) => { ...@@ -2116,7 +2115,7 @@ audioManager.off('deviceChange', (deviceChanged) => {
}); });
``` ```
### on('interrupt')<sup>(deprecated)</sup> ### on('interrupt')
on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback\<InterruptAction>): void on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback\<InterruptAction>): void
...@@ -2124,10 +2123,6 @@ Subscribes to audio interruption events. When the application's audio is interru ...@@ -2124,10 +2123,6 @@ Subscribes to audio interruption events. When the application's audio is interru
Same as [on('audioInterrupt')](#onaudiointerrupt9), this API is used to listen for focus changes. However, this API is used in scenarios without audio streams (no **AudioRenderer** instance is created), such as frequency modulation (FM) and voice wakeup. Same as [on('audioInterrupt')](#onaudiointerrupt9), this API is used to listen for focus changes. However, this API is used in scenarios without audio streams (no **AudioRenderer** instance is created), such as frequency modulation (FM) and voice wakeup.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.Multimedia.Audio.Renderer **System capability**: SystemCapability.Multimedia.Audio.Renderer
**Parameters** **Parameters**
...@@ -2158,16 +2153,12 @@ audioManager.on('interrupt', interAudioInterrupt, (InterruptAction) => { ...@@ -2158,16 +2153,12 @@ audioManager.on('interrupt', interAudioInterrupt, (InterruptAction) => {
}); });
``` ```
### off('interrupt')<sup>(deprecated)</sup> ### off('interrupt')
off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback\<InterruptAction>): void off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback\<InterruptAction>): void
Unsubscribes from audio interruption events. Unsubscribes from audio interruption events.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9.
**System capability**: SystemCapability.Multimedia.Audio.Renderer **System capability**: SystemCapability.Multimedia.Audio.Renderer
**Parameters** **Parameters**
...@@ -2332,7 +2323,7 @@ Subscribes to system volume change events. This API uses an asynchronous callbac ...@@ -2332,7 +2323,7 @@ Subscribes to system volume change events. This API uses an asynchronous callbac
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when the system volume changes.| | type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when the system volume changes.|
| callback | Callback<[VolumeEvent](#volumeevent8)> | Yes | Callback used to return the system volume change event. | | callback | Callback<[VolumeEvent](#volumeevent9)> | Yes | Callback used to return the system volume change event. |
**Error codes** **Error codes**
...@@ -3940,12 +3931,13 @@ Describes the audio renderer change event. ...@@ -3940,12 +3931,13 @@ Describes the audio renderer change event.
**System capability**: SystemCapability.Multimedia.Audio.Renderer **System capability**: SystemCapability.Multimedia.Audio.Renderer
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| ------------- | ---------------------------------------- | -------- | -------- | ---------------------------------------------------------- | | ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| streamId | number | Yes | No | Unique ID of an audio stream. | | streamId | number | Yes | No | Unique ID of an audio stream. |
| clientUid | number | Yes | No | UID of the audio renderer client.<br>This is a system API. | | clientUid | number | Yes | No | UID of the audio renderer client.<br>This is a system API. |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. | | rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. |
| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. | | rendererState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. |
| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. |
**Example** **Example**
...@@ -3998,12 +3990,13 @@ Describes the audio capturer change event. ...@@ -3998,12 +3990,13 @@ Describes the audio capturer change event.
**System capability**: SystemCapability.Multimedia.Audio.Capturer **System capability**: SystemCapability.Multimedia.Audio.Capturer
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| ------------- | ---------------------------------------- | -------- | -------- | ---------------------------------------------------------- | | ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| streamId | number | Yes | No | Unique ID of an audio stream. | | streamId | number | Yes | No | Unique ID of an audio stream. |
| clientUid | number | Yes | No | UID of the audio capturer client.<br>This is a system API. | | clientUid | number | Yes | No | UID of the audio capturer client.<br>This is a system API. |
| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. | | capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. |
| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. | | capturerState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. |
| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. |
**Example** **Example**
...@@ -4097,7 +4090,7 @@ Implements filter criteria. Before calling **selectOutputDeviceByFilter**, you m ...@@ -4097,7 +4090,7 @@ Implements filter criteria. Before calling **selectOutputDeviceByFilter**, you m
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------ | ---------------------------------------- | --------- | ------------------------------------------------------------ | | ------------ | ---------------------------------------- | --------- | ------------------------------------------------------------ |
| uid | number | Yes | Application ID.<br> **System capability**: SystemCapability.Multimedia.Audio.Core | | uid | number | Yes | Application ID.<br> **System capability**: SystemCapability.Multimedia.Audio.Core |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer | | rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer |
| rendererId | number | No | Unique ID of an audio stream.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer | | rendererId | number | No | Unique ID of an audio stream.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer |
...@@ -4950,18 +4943,18 @@ audioRenderer.setVolume(0.5, (err, data)=>{ ...@@ -4950,18 +4943,18 @@ audioRenderer.setVolume(0.5, (err, data)=>{
on(type: 'audioInterrupt', callback: Callback\<InterruptEvent>): void on(type: 'audioInterrupt', callback: Callback\<InterruptEvent>): void
Subscribes to audio interruption events. This API uses a callback to get interrupt events. Subscribes to audio interruption events. This API uses a callback to obtain interrupt events.
Same as [on('interrupt')](#oninterruptdeprecated), this API has obtained the focus before **start**, **pause**, or **stop** of **AudioRenderer** is called. Therefore, you do not need to request the focus. Same as [on('interrupt')](#oninterrupt), this API is used to listen for focus changes. The **AudioRenderer** instance proactively gains the focus when the **start** event occurs and releases the focus when the **pause** or **stop** event occurs. Therefore, you do not need to request to gain or release the focus.
**System capability**: SystemCapability.Multimedia.Audio.Interrupt **System capability**: SystemCapability.Multimedia.Audio.Interrupt
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | -------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value **'audioInterrupt'** means the audio interruption event, which is triggered when audio playback is interrupted. | | type | string | Yes | Event type. The value **'audioInterrupt'** 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. | | callback | Callback\<[InterruptEvent](#interruptevent9)\> | Yes | Callback used to return the audio interruption event. |
**Error codes** **Error codes**
...@@ -4969,7 +4962,7 @@ For details about the error codes, see [Audio Error Codes](../errorcodes/errorco ...@@ -4969,7 +4962,7 @@ For details about the error codes, see [Audio Error Codes](../errorcodes/errorco
| ID | Error Message | | ID | Error Message |
| ------- | ------------------------------ | | ------- | ------------------------------ |
| 6800101 | if input parameter value error | | 6800101 | if input parameter value error |
**Example** **Example**
...@@ -6111,7 +6104,7 @@ Describes the callback invoked for audio interruption or focus gain events. ...@@ -6111,7 +6104,7 @@ Describes the callback invoked for audio interruption or focus gain events.
> **NOTE** > **NOTE**
> >
> This API is supported since API version 7 and deprecated since API version 9. > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [InterruptEvent](#interruptevent9).
**System capability**: SystemCapability.Multimedia.Audio.Renderer **System capability**: SystemCapability.Multimedia.Audio.Renderer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册