@@ -91,7 +91,7 @@ Enable the default system audio effect.
## Obtaining the Global Audio Effect Mode
You can obtain the global audio effect mode corresponding to a specific audio content type (specified by **ContentType**) and audio stream usage (specified by **StreamUsage**).
You can obtain the global audio effect mode corresponding to a specific audio stream usage (specified by **StreamUsage**).
For an audio playback application, pay attention to the audio effect mode used by the audio stream of the application and perform corresponding operations. For example, for a music application, select the audio effect mode for the music scenario. Before obtaining the global audio effect mode, call **getStreamManager()** to create an **AudioStreamManager** instance.
### Creating an AudioStreamManager Instance
...
...
@@ -107,7 +107,7 @@ Create an **AudioStreamManager** instance. Before using **AudioStreamManager** A
### Querying the Audio Effect Mode of the Corresponding Scenario
Selects an audio track. This API can be called only when the AVPlayer is in the prepared state. You can listen for the [trackChange event](#trackchange_on) to determine whether the API calling takes effect.
Deselects an audio track. The default audio track will be used after the audio track is deselected. This API can be called only when the AVPlayer is in the prepared state. You can listen for the [trackChange event](#trackchange_on) to determine whether the API calling takes effect.
Obtains the ID of the current track. This API uses an asynchronous callback to return the result. It can be called only when the AVPlayer is in the prepared, playing, paused, or completed state.
| trackType | [MediaType](#mediatype) | Yes | Enumerates the media types. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the current track. If **-1** is returned, no track for the specified media type exists.|
**Error codes**
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
Obtains the ID of the current track. This API uses a promise to return the result. It can be called only when the AVPlayer is in the prepared, playing, paused, or completed state.
| type | string | Yes | Event type, which is **'trackChange'** in this case.|
**Example**
```js
avPlayer.off('trackChange')
```
## AVPlayerState<sup>9+</sup><a name = avplayerstate></a>
Enumerates the states of the [AVPlayer](#avplayer9). Your application can proactively obtain the AVPlayer state through the **state** attribute or obtain the reported AVPlayer state by subscribing to the [stateChange](#stateChange_on) event. For details about the rules for state transition, see [Audio Playback](../../media/using-avplayer-for-playback.md).
...
...
@@ -2680,6 +2518,8 @@ Enumerates the AVRecorder states. You can obtain the state through the **state**
Describes the audio and video recording parameters.
The **audioSourceType** and **videoSourceType** parameters are used to distinguish audio-only recording, video-only recording, and audio and video recording. For audio-only recording, set only **audioSourceType**. For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
@@ -2691,8 +2531,6 @@ Describes the audio and video recording parameters.
| rotation | number | No | Rotation angle of the recorded video. The value can only be 0 (default), 90, 180, or 270. |
| location | [Location](#location) | No | Geographical location of the recorded video. By default, the geographical location information is not recorded. |
The **audioSourceType** and **videoSourceType** parameters are used to distinguish audio-only recording, video-only recording, and audio and video recording. For audio-only recording, set only **audioSourceType**. For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
## AVRecorderProfile<sup>9+</sup>
Describes the audio and video recording profile.
...
...
@@ -3517,13 +3355,15 @@ Enumerates the video recording states. You can obtain the state through the **st
Describes the video recording parameters.
The **audioSourceType** and **videoSourceType** parameters are used to distinguish video-only recording from audio and video recording. (For audio-only recording recording, use **[AVRecorder](#avrecorder9)** or **[AudioRecorder](#audiorecorderdeprecated)**.) For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
| audioSourceType | [AudioSourceType](#audiosourcetype9) | Yes | Type of the audio source for video recording. |
| audioSourceType | [AudioSourceType](#audiosourcetype9) | No | Type of the audio source for video recording. This parameter is mandatory for audio recording. |
| videoSourceType | [VideoSourceType](#videosourcetype9) | Yes | Type of the video source for video recording. |