From 1aaa4544298ee35a622eb750c3da1ec12464b50b Mon Sep 17 00:00:00 2001 From: sda-rob <149643938+sda-rob@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:17:48 +0800 Subject: [PATCH] [AUTO] Generate codes by terra (#1184) Co-authored-by: guoxianzhe --- ts/Private/AgoraBase.ts | 51 +++++++++++++------------- ts/Private/AgoraMediaBase.ts | 6 +-- ts/Private/IAgoraMediaEngine.ts | 4 ++ ts/Private/IAgoraRtcEngine.ts | 24 ++++++------ ts/Private/IAudioDeviceManager.ts | 4 +- ts/Private/impl/IAgoraRtcEngineImpl.ts | 2 +- 6 files changed, 47 insertions(+), 44 deletions(-) diff --git a/ts/Private/AgoraBase.ts b/ts/Private/AgoraBase.ts index 50348f706..93dadfa7a 100644 --- a/ts/Private/AgoraBase.ts +++ b/ts/Private/AgoraBase.ts @@ -319,7 +319,7 @@ export enum ErrorCodeType { */ ErrSetClientRoleNotAuthorized = 119, /** - * 120: Decryption fails. The user might have entered an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel. + * 120: Media streams decryption fails. The user might use an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel. */ ErrDecryptionFailed = 120, /** @@ -1447,11 +1447,11 @@ export enum SimulcastStreamMode { */ export class SimulcastStreamConfig { /** - * The video dimension. See VideoDimensions. The default value is 160 × 120. + * The video dimension. See VideoDimensions. The default value is 50% of the high-quality video stream. */ dimensions?: VideoDimensions; /** - * Video receive bitrate (Kbps), represented by an instantaneous value. The default value is 65. + * Video receive bitrate (Kbps), represented by an instantaneous value. This parameter does not need to be set. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you set. */ kBitrate?: number; /** @@ -1860,15 +1860,15 @@ export enum AudioScenarioType { */ export class VideoFormat { /** - * The width (px) of the video frame. + * The width (px) of the video frame. The default value is 960. */ width?: number; /** - * The height (px) of the video frame. + * The height (px) of the video frame. The default value is 540. */ height?: number; /** - * The video frame rate (fps). + * The video frame rate (fps). The default value is 15. */ fps?: number; } @@ -2065,11 +2065,11 @@ export enum LocalAudioStreamReason { */ LocalAudioStreamReasonEncodeFailure = 5, /** - * 6: No local audio capture device. Remind your users to check whether the microphone is connected to the device properly in the control plane of the device or if the microphone is working properly. + * 6: No local audio capture device. Remind your users to check whether the microphone is connected to the device properly in the control panel of the device or if the microphone is working properly. */ LocalAudioStreamReasonNoRecordingDevice = 6, /** - * 7: No local audio capture device. Remind your users to check whether the speaker is connected to the device properly in the control plane of the device or if the speaker is working properly. + * 7: No local audio capture device. Remind your users to check whether the speaker is connected to the device properly in the control panel of the device or if the speaker is working properly. */ LocalAudioStreamReasonNoPlayoutDevice = 7, /** @@ -2077,11 +2077,11 @@ export enum LocalAudioStreamReason { */ LocalAudioStreamReasonInterrupted = 8, /** - * 9: (Windows only) The ID of the local audio-capture device is invalid. Check the audio capture device ID. + * 9: (Windows only) The ID of the local audio-capture device is invalid. Prompt the user to check the audio capture device ID. */ LocalAudioStreamReasonRecordInvalidId = 9, /** - * 10: (Windows only) The ID of the local audio-playback device is invalid. Check the audio playback device ID. + * 10: (Windows only) The ID of the local audio-playback device is invalid. Prompt the user to check the audio playback device ID. */ LocalAudioStreamReasonPlayoutInvalidId = 10, } @@ -2121,15 +2121,15 @@ export enum LocalVideoStreamReason { */ LocalVideoStreamReasonFailure = 1, /** - * 2: No permission to use the local video capturing device. Remind the user to grant permissions and rejoin the channel. Deprecated: This enumerator is deprecated. Please use CAMERA in the onPermissionError callback instead. + * 2: No permission to use the local video capturing device. Prompt the user to grant permissions and rejoin the channel. Deprecated: This enumerator is deprecated. Please use CAMERA in the onPermissionError callback instead. */ LocalVideoStreamReasonDeviceNoPermission = 2, /** - * 3: The local video capturing device is in use. Remind the user to check whether another application occupies the camera. + * 3: The local video capturing device is in use. Prompt the user to check if the camera is being used by another app, or try to rejoin the channel. */ LocalVideoStreamReasonDeviceBusy = 3, /** - * 4: The local video capture fails. Remind your user to check whether the video capture device is working properly, whether the camera is occupied by another application, or try to rejoin the channel. + * 4: The local video capture fails. Prompt the user to check whether the video capture device is working properly, whether the camera is used by another app, or try to rejoin the channel. */ LocalVideoStreamReasonCaptureFailure = 4, /** @@ -2169,12 +2169,12 @@ export enum LocalVideoStreamReason { */ LocalVideoStreamReasonDeviceSystemPressure = 101, /** - * 11: (macOS and Windows only) The shared windows is minimized when you call the startScreenCaptureByWindowId method to share a window. The SDK cannot share a minimized window. You can cancel the minimization of this window at the application layer, for example by maximizing this window. + * 11: (macOS and Windows only) The shared window is minimized when you call the startScreenCaptureByWindowId method to share a window. The SDK cannot share a minimized window. Please prompt the user to unminimize the shared window. */ LocalVideoStreamReasonScreenCaptureWindowMinimized = 11, /** * 12: (macOS and Windows only) The error code indicates that a window shared by the window ID has been closed or a full-screen window shared by the window ID has exited full-screen mode. After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a black screen, Agora recommends that you immediately stop screen sharing. Common scenarios reporting this error code: - * When the local user closes the shared window, the SDK reports this error code. + * The local user closes the shared window. * The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After the user exits full-screen mode, the SDK reports this error code. * The local user watches a web video or reads a web document in full-screen mode first, and then shares the window of the web video or document. After the user exits full-screen mode, the SDK reports this error code. */ @@ -3439,7 +3439,7 @@ export class VideoCanvas { */ subviewUid?: number; /** - * The video display window. + * The video display window. In one VideoCanvas, you can only choose to set either view or surfaceTexture. If both are set, only the settings in view take effect. */ view?: any; /** @@ -3473,8 +3473,7 @@ export class VideoCanvas { */ cropArea?: Rectangle; /** - * (Optional) Whether the receiver enables alpha mask rendering: true : The receiver enables alpha mask rendering. false : (default) The receiver disables alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking. - * This property applies to macOS only. + * (Optional) Whether the receiver enables alpha mask rendering: true : The receiver enables alpha mask rendering. false : (Default) The receiver disables alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking. * The receiver can render alpha channel information only when the sender enables alpha transmission. * To enable alpha transmission,. */ @@ -3722,7 +3721,7 @@ export class SegmentationProperty { */ modelType?: SegModelType; /** - * The range of accuracy for identifying green colors (different shades of green) in the view. The value range is [0,1], and the default value is 0.5. The larger the value, the wider the range of identifiable shades of green. When the value of this parameter is too large, the edge of the portrait and the green color in the portrait range are also detected. Agora recommends that you dynamically adjust the value of this parameter according to the actual effect. This parameter only takes effect when modelType is set to SegModelGreen. + * The accuracy range for recognizing background colors in the image. The value range is [0,1], and the default value is 0.5. The larger the value, the wider the range of identifiable shades of pure color. When the value of this parameter is too large, the edge of the portrait and the pure color in the portrait range are also detected. Agora recommends that you dynamically adjust the value of this parameter according to the actual effect. This parameter only takes effect when modelType is set to SegModelGreen. */ greenCapacity?: number; } @@ -4526,7 +4525,7 @@ export class EncryptionConfig { */ encryptionKdfSalt?: number[]; /** - * @ignore + * Whether to enable data stream encryption: true : Enable data stream encryption. false : (Default) Disable data stream encryption. */ datastreamEncryptionEnabled?: boolean; } @@ -4540,11 +4539,11 @@ export enum EncryptionErrorType { */ EncryptionErrorInternalFailure = 0, /** - * 1: Decryption errors. Ensure that the receiver and the sender use the same encryption mode and key. + * 1: Media stream decryption error. Ensure that the receiver and the sender use the same encryption mode and key. */ EncryptionErrorDecryptionFailure = 1, /** - * 2: Encryption errors. + * 2: Media stream encryption error. */ EncryptionErrorEncryptionFailure = 2, /** @@ -4696,19 +4695,19 @@ export class UserInfo { } /** - * The audio filter of in-ear monitoring. + * The audio filter types of in-ear monitoring. */ export enum EarMonitoringFilterType { /** - * 1<<0: Do not add an audio filter to the in-ear monitor. + * 1<<0: No audio filter added to in-ear monitoring. */ EarMonitoringFilterNone = 1 << 0, /** - * 1<<1: Add an audio filter to the in-ear monitor. If you implement functions such as voice beautifier and audio effect, users can hear the voice after adding these effects. + * 1<<1: Add vocal effects audio filter to in-ear monitoring. If you implement functions such as voice beautifier and audio effect, users can hear the voice after adding these effects. */ EarMonitoringFilterBuiltInAudioFilters = 1 << 1, /** - * 1<<2: Enable noise suppression to the in-ear monitor. + * 1<<2: Add noise suppression audio filter to in-ear monitoring. */ EarMonitoringFilterNoiseSuppression = 1 << 2, /** diff --git a/ts/Private/AgoraMediaBase.ts b/ts/Private/AgoraMediaBase.ts index 377b1fbdd..a4d75cfa9 100644 --- a/ts/Private/AgoraMediaBase.ts +++ b/ts/Private/AgoraMediaBase.ts @@ -208,7 +208,7 @@ export enum MediaSourceType { */ SecondaryScreenSource = 5, /** - * 6. Custom video source. + * 6: Custom video source. */ CustomVideoSource = 6, /** @@ -680,7 +680,7 @@ export class VideoFrame { */ rotation?: number; /** - * The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. It is required. + * The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. This parameter is required. */ renderTimeMs?: number; /** @@ -798,7 +798,7 @@ export class AudioFrame { */ samplesPerChannel?: number; /** - * The number of bytes per sample. The number of bytes per audio sample, which is usually 16-bit (2-byte). + * The number of bytes per sample. For PCM, this parameter is generally set to 16 bits (2 bytes). */ bytesPerSample?: BytesPerSample; /** diff --git a/ts/Private/IAgoraMediaEngine.ts b/ts/Private/IAgoraMediaEngine.ts index 6fd166367..c359c3570 100644 --- a/ts/Private/IAgoraMediaEngine.ts +++ b/ts/Private/IAgoraMediaEngine.ts @@ -107,6 +107,10 @@ export abstract class IMediaEngine { /** * Pushes the external audio frame. * + * Before calling this method to push external audio data, perform the following steps: + * Call createCustomAudioTrack to create a custom audio track and get the audio track ID. + * Call joinChannel to join the channel. In ChannelMediaOptions, set publishCustomAduioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true. + * * @param frame The external audio frame. See AudioFrame. * @param trackId The audio track ID. If you want to publish a custom external audio source, set this parameter to the ID of the corresponding custom audio track you want to publish. * diff --git a/ts/Private/IAgoraRtcEngine.ts b/ts/Private/IAgoraRtcEngine.ts index 40c17651b..307607946 100644 --- a/ts/Private/IAgoraRtcEngine.ts +++ b/ts/Private/IAgoraRtcEngine.ts @@ -551,7 +551,7 @@ export class RemoteAudioStats { */ rxAudioBytes?: number; /** - * @ignore + * End-to-end audio delay (in milliseconds), which refers to the time from when the audio is captured by the remote user to when it is played by the local user. */ e2eDelay?: number; } @@ -823,11 +823,11 @@ export class PublisherConfiguration { */ export enum CameraDirection { /** - * The rear camera. + * 0: The rear camera. */ CameraRear = 0, /** - * The front camera. + * 1: (Default) The front camera. */ CameraFront = 1, } @@ -863,7 +863,7 @@ export class CameraCapturerConfiguration { */ cameraFocalLengthType?: CameraFocalLengthType; /** - * This method applies to Windows only. The ID of the camera. The maximum length is MaxDeviceIdLengthType. + * The camera ID. The maximum length is MaxDeviceIdLengthType. */ deviceId?: string; /** @@ -871,11 +871,11 @@ export class CameraCapturerConfiguration { */ cameraId?: string; /** - * Whether to follow the video aspect ratio set in setVideoEncoderConfiguration : true : (Default) Follow the set video aspect ratio. The SDK crops the captured video according to the set video aspect ratio and synchronously changes the local preview screen and the video frame in onCaptureVideoFrame and onPreEncodeVideoFrame. false : Do not follow the system default audio playback device. The SDK does not change the aspect ratio of the captured video frame. + * (Optional) Whether to follow the video aspect ratio set in setVideoEncoderConfiguration : true : (Default) Follow the set video aspect ratio. The SDK crops the captured video according to the set video aspect ratio and synchronously changes the local preview screen and the video frame in onCaptureVideoFrame and onPreEncodeVideoFrame. false : Do not follow the system default audio playback device. The SDK does not change the aspect ratio of the captured video frame. */ followEncodeDimensionRatio?: boolean; /** - * The format of the video frame. See VideoFormat. + * (Optional) The format of the video frame. See VideoFormat. */ format?: VideoFormat; } @@ -1171,7 +1171,7 @@ export class ChannelMediaOptions { */ channelProfile?: ChannelProfileType; /** - * @ignore + * Delay (in milliseconds) for sending audio frames. You can use this parameter to set the delay of the audio frames that need to be sent, to ensure audio and video synchronization. To switch off the delay, set the value to 0. */ audioDelayMs?: number; /** @@ -1584,7 +1584,7 @@ export interface IRtcEngineEventHandler { * Occurs when the local video stream state changes. * * When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. The SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateFailed and error code of LocalVideoStreamReasonCaptureFailure in the following situations: - * The app switches to the background, and the system gets the camera resource. + * The app goes to the background and the system revokes the camera permission. * The camera starts normally, but does not output video frames for four consecutive seconds. When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateCapturing and error code of LocalVideoStreamReasonCaptureFailure. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. For some device models, the SDK does not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment. * * @param source The type of the video source. See VideoSourceType. @@ -5176,7 +5176,7 @@ export abstract class IRtcEngine { * You can call this method either before or after joining a channel. * * @param enabled Enables or disables in-ear monitoring. true : Enables in-ear monitoring. false : (Default) Disables in-ear monitoring. - * @param includeAudioFilters The audio filter of in-ear monitoring: See EarMonitoringFilterType. + * @param includeAudioFilters The audio filter types of in-ear monitoring. See EarMonitoringFilterType. * * @returns * 0: Success. @@ -5598,7 +5598,7 @@ export abstract class IRtcEngine { * @ignore */ abstract queryCameraFocalLengthCapability(): { - focalLengthInfos: FocalLengthInfo; + focalLengthInfos: FocalLengthInfo[]; size: number; }; @@ -5629,7 +5629,7 @@ export abstract class IRtcEngine { /** * Retrieves the call ID. * - * When a user joins a channel on a client, a callId is generated to identify the call from the client. Some methods, such as rate and complain, must be called after the call ends to submit feedback to the SDK. These methods require the callId parameter. Call this method after joining a channel. + * When a user joins a channel on a client, a callId is generated to identify the call from the client. You can call this method to get the callId parameter, and pass it in when calling methods such as rate and complain. Call this method after joining a channel. * * @returns * The current call ID, if the method succeeds. @@ -5932,7 +5932,7 @@ export abstract class IRtcEngine { * * In scenarios requiring high security, Agora recommends calling this method to enable the built-in encryption before joining a channel. All users in the same channel must use the same encryption mode and encryption key. After the user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again. If you enable the built-in encryption, you cannot use the Media Push function. * - * @param enabled Whether to enable built-in encryption: true : Enable the built-in encryption. false : Disable the built-in encryption. + * @param enabled Whether to enable built-in encryption: true : Enable the built-in encryption. false : (Default) Disable the built-in encryption. * @param config Built-in encryption configurations. See EncryptionConfig. * * @returns diff --git a/ts/Private/IAudioDeviceManager.ts b/ts/Private/IAudioDeviceManager.ts index ad7b49f87..15af2011b 100644 --- a/ts/Private/IAudioDeviceManager.ts +++ b/ts/Private/IAudioDeviceManager.ts @@ -55,7 +55,7 @@ export abstract class IAudioDeviceManager { abstract getPlaybackDevice(): string; /** - * Retrieves the audio playback device associated with the device ID. + * Retrieves the information of the audio playback device. * * @returns * An AudioDeviceInfo object, which contains the ID and device name of the audio devices. @@ -105,7 +105,7 @@ export abstract class IAudioDeviceManager { abstract getRecordingDevice(): string; /** - * Retrieves the volume of the audio recording device. + * Retrieves the information of the audio recording device. * * @returns * An AudioDeviceInfo object, which includes the device ID and device name. diff --git a/ts/Private/impl/IAgoraRtcEngineImpl.ts b/ts/Private/impl/IAgoraRtcEngineImpl.ts index f7345812e..3eb536a1b 100644 --- a/ts/Private/impl/IAgoraRtcEngineImpl.ts +++ b/ts/Private/impl/IAgoraRtcEngineImpl.ts @@ -5261,7 +5261,7 @@ export class IRtcEngineImpl implements IRtcEngine { } queryCameraFocalLengthCapability(): { - focalLengthInfos: FocalLengthInfo; + focalLengthInfos: FocalLengthInfo[]; size: number; } { const apiType = this.getApiTypeFromQueryCameraFocalLengthCapability();