This topic describes the AliRtcEngine interface of the Electron SDK.

Contents

Define a constructor
constructor(option: AliEngineOption)
Parameter Type Description
option AliEngineOption Engine initialization parameters.
Note The H5 compatibility mode in the parameter indicates whether communication with the Web client is normal. By default, this mode is disabled.

Basic methods

API Description Supported earliest version
destroy SDK resources are released. 2.5.2

Channel-related interfaces

API Description Supported earliest version
joinChannel Join the channel. 2.5.2
leaveChannel Off the channel. 2.5.2
isInCall Check whether you are currently in the channel. 2.5.2
setChannelProfile Set the channel mode. 2.5.2

Publish related interfaces

API Description Supported earliest version
publishLocalVideoStream Specify whether to allow video streaming. 2.5.2
isLocalVideoStreamPublished Queries whether video streaming is currently allowed. 2.5.2
isScreenSharePublished Queries whether the ingest screen stream is currently allowed. 2.5.2
publishLocalAudioStream Specifies whether to allow ingest audio streams. 2.5.2
isLocalAudioStreamPublished Queries whether audio streams are currently allowed. 2.5.2
publishLocalDualStream Specify whether to allow pushing secondary video streams. 2.5.2
isDualStreamPublished You can call this operation to query whether a secondary video stream is currently allowed to be pushed. 2.5.2

Subscription-related interfaces

API Description Supported earliest version
setRemoteVideoStreamType Specifies the format of the camera stream for the subscription. 2.5.2
setRemoteDefaultVideoStreamType Sets the camera stream format for the default subscription. 2.5.2
setDefaultSubscribeAllRemoteAudioStreams Specifies whether to pull the audio stream by default. 2.5.2
subscribeAllRemoteAudioStreams Stop or resume pulling all remote audio streams. 2.5.2
subscribeRemoteAudioStream Stops or resumes audio stream pulling for a specific remote user. 2.5.2
setDefaultSubscribeAllRemoteVideoStreams Specifies whether to pull video streams by default. 2.5.2
subscribeAllRemoteVideoStreams Stop or resume pulling all remote video streams. 2.5.2
subscribeRemoteVideoStream Stops or resumes video stream pulling for a specific remote user. 2.5.2

Video-related methods

API Description Supported earliest version
setScreenShareEncoderConfiguration Set the screen share encoding properties. 2.5.2
setLocalViewConfig Set the rendering window and drawing parameters for local preview. 2.5.2
enableLocalVideo Disable or re-enable local video collection. 2.5.2
muteLocalCamera Specify whether to stop pushing local video streams. 2.5.2
setRemoteViewConfig Set the rendering window for the video at the far end. 2.5.2
stopRecord Stop recording. 2.5.2
startRecord Start recording. 2.5.2
pauseRecord Pause recording. 2.5.2
resumeRecord Start recording again. 2.5.2
setBeautyEffect Set Basic Beauty. 2.5.2
setVideoEncoderConfiguration Set video encoding properties. 2.5.2

Shared video interface

API Description Supported earliest version
startScreenShareByDesktopId Screen sharing based on the desktop ID. 2.5.2
startScreenShareByWindowId Screen sharing based on the window ID. 2.5.2
stopScreenShare Stop screen sharing. 2.5.2
getScreenShareConfig Gets the screen sharing configuration. 2.5.2
getScreenShareSourceInfo Gets the screen sharing source information. 2.5.2
getCurrentScreenShareSourceId Gets the current screen share source ID. 2.5.2
getCurrentScreenShareSourceType Gets the current screen share source type. 2.5.2

Audio-related methods

API Description Supported earliest version
muteLocalMic Specify whether to stop pushing local audio. 2.5.2
muteRemoteAudio Specifies whether to stop playing remote audio streams. 2.5.2
muteAllRemoteAudio Stop or resume all audio playback at the far end. 2.5.2
startAudioCapture Enable audio collection. 2.5.2
stopAudioCapture Disable audio collection. 2.5.2
startAudioPlayer Turn on the audio playback device. 2.5.2
stopAudioPlayer Disables audio playback. 2.5.2
enableAudioVolumeIndication Set the volume callback frequency and smoothing factor. 2.5.2
setAudioProfile Set Audio Profile. 2.5.2
startAudioAccompany Start mixing. 2.5.2
stopAudioAccompany Stop mixing. 2.5.2
setAudioAccompanyVolume Set the mixing volume. 2.5.2
setAudioAccompanyPublishVolume Set the volume of the stream after mixing. 2.5.2
getAudioAccompanyPublishVolume Gets the remix volume of the stream. 2.5.2
setAudioAccompanyPlayoutVolume Sets the volume of local playback after mixing. 2.5.2
getAudioAccompanyPlayoutVolume Gets the volume of the local playback of the mix. 2.5.2
pauseAudioAccompany Suspend mixing. 2.5.2
resumeAudioAccompany Start the remix again. 2.5.2
getAudioAccompanyDuration Gets the duration of the accompaniment file. 2.5.2
getAudioAccompanyCurrentPosition Gets the music file playback progress. 2.5.2
setAudioAccompanyPosition Sets the playback position of background music. 2.5.2
enableSystemAudioRecording Specify whether to enable system sound collection and push. 2.5.2
isSystemAudioRecording Specifies whether to enable system sound collection and push. 2.5.2
setSystemAudioRecordingVolume Set the system sound collection push volume. 2.5.2
getSystemAudioRecordingVolume Gets the currently set system sound collection push volume. 2.5.2

Audio device management port

API Description Supported earliest version
getAudioCaptureList Obtains the list of recording devices in the system. 2.5.2
getCurrentAudioCaptureName Gets the recording device name used. 2.5.2
getCurrentAudioCaptureID Gets the ID of the recording device used. 2.5.2
setCurrentAudioCaptureName Select a recording device name. 2.5.2
setCurrentAudioCaptureID Select the recording device ID. 2.5.2
getAudioPlayerList Gets the list of speakers in the system. 2.5.2
getCurrentAudioPlayerName Gets the name of the speaker currently in use. 2.5.2
getCurrentAudioPlayerID Gets the ID of the speaker currently in use. 2.5.2
setCurrentAudioPlayerName Select the speaker name. 2.5.2
setCurrentAudioPlayerID Select the speaker ID. 2.5.2
startTestAudioRecordByName Start testing the audio capture device. 2.5.2
startTestAudioRecordById Turn on the microphone device test (by device ID). 2.5.2
stopTestAudioRecord Stop testing the audio capture device. 2.5.2
startTestAudioPlayoutByName Start testing the audio playback device. 2.5.2
startTestAudioPlayoutById Turn on the speaker device test (by device ID). 2.5.2
stopTestAudioPlayout Stop testing the audio playback device. 2.5.2

Video device management interface

API Description Supported earliest version
getCameraList Gets the list of cameras. 2.5.2
getCurrentCameraName Gets the name of the camera currently in use. 2.5.2
getCurrentCameraID Gets the ID of the currently used camera. 2.5.2
setCurrentCameraName Select the camera name. 2.5.2
setCurrentCameraID Select the camera ID. 2.5.2

Preview Port

API Description Supported earliest version
startPreview Open Preview. 2.5.2
stopPreview Stop the preview. 2.5.2

Remote user query interface

API Description Supported earliest version
getUserInfo Queries remote user information. 2.5.2

Other operations

API Description Supported earliest version
getSDKVersion Obtain the SDK version number. 2.5.2
setClientRole Specify a user role. 2.5.2
getClientRole Gets the user role. 2.5.2
startLastmileDetect Start network quality detection. 2.5.2
stopLastmileDetect Stop network quality detection. 2.5.2
getCurrentConnectionStatus Gets the current network link status. 2.5.2
on Subscribe to events. 2.5.2
off Unsubscribe from an event. 2.5.2

Details

  • destroy: The SDK resources are released.
    destroy(): void;
  • joinChannel: joins a channel.
    joinChannel(authInfo: AliEngineAuthInfo, options?: ChannelMediaOptions): number;
    Parameter description
    Parameter Type Description
    authInfo AliEngineAuthInfo The authentication information.
    options ChannelMediaOptions Subscription options.
    Note
    • After joining the channel successfully, if you need to join another channel in the middle, you must first call the leaveChannel to leave the current channel.
    • If you fail to join a channel, you do not need to call the leaveChannel first.
    • This interface is an asynchronous interface. Whether it is successfully added to the channel is determined by onJoinChannelResult.
  • leaveChannel: leaves the channel.
    leaveChannel (): number;
    Note This interface is an asynchronous interface. Whether it successfully leaves the channel is determined by onJoinChannelResult.
  • isInCall: checks whether it is currently in the channel.
    isInCall(): boolean;
    Return result

    true indicates that it is in the channel. false indicates that it is not in the channel.

  • setChannelProfile: Set the channel mode (called before joining the conference).
    setChannelProfile (channelProfile: AliEngineChannelProfile): number;
    Parameter description
    Parameter Type Description
    channelProfile AliEngineChannelProfile The channel type. Default communication mode.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • publishLocalVideoStream: specifies whether to allow video streaming.
    publishLocalVideoStream (enable: boolean): number;
    Parameter description
    Parameter Type Description
    enable boolean Specifies whether to allow video streaming. Valid values:
    • true (default): allows video streaming.
    • false: video streaming is not allowed.
  • isLocalVideoStreamPublished: queries whether video streaming is allowed.
    isLocalVideoStreamPublished (): boolean;
    Return result

    true indicates allowed. false indicates not allowed.

  • isScreenSharePublished: queries whether the screen stream is currently allowed.
    isScreenSharePublished (): boolean;
    Return result

    true indicates allowed. false indicates not allowed.

  • publishLocalAudioStream: specifies whether to allow audio streaming.
    publishLocalAudioStream (enable: boolean): number;
    Parameter description
    Parameter Type Description
    enable boolean Specifies whether to allow ingest audio streams. Valid values:
    • true (default): allows you to ingest audio streams.
    • false: The audio stream cannot be ingested.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isLocalAudioStreamPublished: queries whether audio streams are allowed.
    isLocalAudioStreamPublished (): boolean;
    Return result

    true indicates allowed. false indicates not allowed.

  • publishLocalDualStream: specifies whether to allow pushing secondary video streams.
    publishLocalDualStream (enabled: boolean): number;
    Parameter description
    Parameter Type Description
    enable boolean Specifies whether to allow pushing secondary video streams. Valid values:
    • true (default): allows you to push secondary video streams.
    • false: You are not allowed to push secondary video streams.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isDualStreamPublished: queries whether the secondary video stream is currently allowed.
    isDualStreamPublished (): boolean;
    Return result

    true indicates allowed. false indicates not allowed.

  • setRemoteVideoStreamType: Specify the format of the camera stream for the subscription.
    setRemoteVideoStreamType (uid: string, streamType: AliEngineVideoStreamType): number;
    Parameter description
    Parameter Type Description
    uid string The ID of the remote user.
    streamType AliEngineVideoStreamType Camera stream format.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setRemoteDefaultVideoStreamType: Sets the format of the camera stream for the default subscription.
    setRemoteDefaultVideoStreamType (streamType: AliEngineVideoStreamType): number;
    Parameter description
    Parameter Type Description
    streamType AliEngineVideoStreamType Camera stream format.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setDefaultSubscribeAllRemoteAudioStreams: specifies whether to pull the audio stream by default.
    setDefaultSubscribeAllRemoteAudioStreams (sub: boolean): number;
    Parameter description
    Parameter Type Description
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • subscribeAllRemoteAudioStreams: Stop or resume pulling all remote audio streams.
    subscribeAllRemoteAudioStreams (sub: boolean): number;
    Parameter description
    Parameter Type Description
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • subscribeRemoteAudioStream: Stops or resumes audio stream pulling for a specific remote user.
    subscribeRemoteAudioStream (uid: string, sub: boolean): number;
    Parameter description
    Parameter Type Description
    uid string The ID of the remote user.
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setDefaultSubscribeAllRemoteVideoStreams: specifies whether to pull video streams by default.
    setDefaultSubscribeAllRemoteVideoStreams (sub: boolean): number;
    Parameter description
    Parameter Type Description
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • subscribeAllRemoteVideoStreams: Stop or resume pulling all remote video streams.
    subscribeAllRemoteVideoStreams (sub: boolean): number;
    Parameter description
    Parameter Type Description
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • subscribeRemoteVideoStream: Stops or resumes video stream pulling for a specific remote user.
    subscribeRemoteVideoStream (uid: string, track: AliEngineVideoTrack, sub: boolean): number;
    Parameter description
    Parameter Type Description
    uid string The ID of the remote user.
    track AliEngineVideoTrack The type of the video stream.
    sub boolean Specifies whether to subscribe.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setScreenShareEncoderConfiguration: Set the Screen Sharing Encoding property.
    setScreenShareEncoderConfiguration (config: AliEngineScreenShareEncoderConfiguration): number;
    Parameter description
    Parameter Type Description
    config AliEngineScreenShareEncoderConfiguration Screen sharing encoding properties.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setLocalViewConfig: Set the rendering window and drawing parameters for the local preview.
    setLocalViewConfig (view: HTMLDivElement): void;
    Parameter description
    Parameter Type Description
    element HTMLDivElement Preview the container.
  • enableLocalVideo: Disable or re-enable local video collection.
    enableLocalVideo (enabled: boolean): number;
    Parameter description
    Parameter Type Description
    enable boolean Disable or re-enable local video collection. Valid values:
    • true (default): enables video collection again.
    • false: stops video collection.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • muteLocalCamera: specifies whether to stop pushing local video streams.
    muteLocalCamera (mute: boolean, track: AliEngineVideoTrack): number;
    Parameter description
    Parameter Type Description
    mute boolean Stop or resume streaming. Valid values:
    • true: stops streaming video streams.
    • false (default): The stream ingest is resumed.
    track AliEngineVideoTrack The type of the video stream whose ingest status needs to be changed.
    Note This interface only controls whether black frames are sent on the specified video stream. The collection and data transmission will not stop. If you need to disable the collection, use the enableLocalVideo interface. If you need to stop the video data transmission, use the publishLocalVideoStream interface.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setRemoteViewConfig: Set a rendering window for the video at the far end.
    setRemoteViewConfig (userId: string, contianer: HTMLDivElement, type: number): void;
    Parameter description
    Parameter Type Description
    uid string The ID of the user.
    container HTMLDivElement The view container.
    type number The type of the video stream. Valid values:
    • 1: Camera.
    • 2: screen.
  • stopRecord: stops recording.
    stopRecord (): boolean;
    Return result

    true indicates that the method call was successful. false indicates that the method call failed.

  • startRecord: starts recording. Currently, only audio recording is supported.
    startRecord (recordType: AliEngineRecordType, recordFormat: AliEngineRecordFormat, filePath: string, audioConfig: AliEngineRecordAudioConfig, videoConfig: AliEngineRecordVideoConfig, isFragment: boolean): boolean;
    Parameter description
    Parameter Type Description
    recordType AliEngineRecordType The recording format.
    recordFormat AliEngineRecordFormat The format of the recording.
    filePath string The file path.
    audioConfig AliEngineRecordAudioConfig Record audio settings.
    videoConfig AliEngineRecordVideoConfig Recording video settings.
    isFragment boolean Indicates whether MP4 internal segmentation is supported. This parameter is valid only when MP4 is recorded.
    Return result

    true indicates that the method call was successful. false indicates that the method call failed.

  • pauseRecord: The recording is paused.
    pauseRecord (): boolean;
    Return result

    true indicates that the method call was successful. false indicates that the method call failed.

  • resumeRecord: starts recording again.
    resumeRecord (): boolean;
    Return result

    true indicates that the method call was successful. false indicates that the method call failed.

  • setBeautyEffect: Set basic beautification. Currently, only whitening and skin grinding are supported.
    setBeautyEffect (enable: boolean, config: AliEngineBeautyConfig): number;
    Parameter description
    Parameter Type Description
    enable boolean Specifies whether to enable basic beautification. Valid values:
    • true: enables TDE.
    • false: does not enable TDE.
    config AliEngineBeautyConfig The basic beauty parameters.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setVideoEncoderConfiguration: Set video encoding properties.
    setVideoEncoderConfiguration (config: AliEngineVideoEncoderConfiguration): number;
    Parameter description
    Parameter Type Description
    config AliEngineVideoEncoderConfiguration Predefined encoding properties.
  • startScreenShareByDesktopId: Screen sharing based on the desktop ID.
    startScreenShareByDesktopId (desktopId: number, config: AliEngineScreenShareConfig): number;
    Parameter description
    Parameter Type Description
    desktopId number The ID of the desktop, which can be obtained through the getScreenShareSourceInfo interface.
    config AliEngineScreenShareConfig Screen sharing configuration.
    Note When you configure the specified area to share, the minimum resolution of the shared area is 16 x 16. If the specified area is less than the minimum resolution, it is reset to the minimum resolution. If the specified area is more than the actual desktop resolution, the entire desktop will be shared.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startScreenShareByWindowId: Screen sharing based on the window ID.
    startScreenShareByWindowId (windowId: number, config: AliEngineScreenShareConfig): number;
    Parameter description
    Parameter Type Description
    windowId number The ID of the window, which can be obtained through the getScreenShareSourceInfo interface.
    config AliEngineScreenShareConfig Screen sharing configuration.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopScreenShare: Stop screen sharing.
    stopScreenShare (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getScreenShareConfig: Get the screen sharing configuration.
    getScreenShareConfig (): AliEngineScreenShareConfig;
    Return result

    Return to the screen sharing configuration information AliEngineScreenShareConfig.

  • getScreenShareSourceInfo: Obtain information about the screen sharing source.
    getScreenShareSourceInfo (sourceType: AliEngineScreenShareType): Promise<AliEngineScreenItemInfo[]>
    Parameter description
    Parameter Type Description
    sourceType AliEngineScreenShareType The type of screen sharing.
    Return result

    Promise returns AliEngineScreenItemInfo[].

  • getCurrentScreenShareSourceId: Obtains the current screen share source ID.
    getCurrentScreenShareSourceId (): string;
    Return result

    Returns the current screen share source ID.

  • getCurrentScreenShareSourceType: Gets the current screen share source type.
    getCurrentScreenShareSourceType (): AliEngineScreenShareType;
    Return result

    Returns the current screen share source type.

  • muteLocalMic: specifies whether to stop pushing local audio.
    muteLocalMic (mute: boolean, mode: AliEngineMuteLocalAudioMode): number;
    Parameter description
    Parameter Type Description
    mute boolean Stop or resume local audio data transmission. Valid values:
    • true: The local audio sends a mute frame.
    • false: returns to normal.
    mode AliEngineMuteLocalAudioMode Mute mode. The default microphone mute mode.
    Note Mute just sends audio data as silent frames, and the acquisition and encoding modules are still working.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • muteRemoteAudio: specifies whether to stop playing the remote audio stream.
    muteRemoteAudio (uid: string, mute: boolean): number;
    Parameter description
    Parameter Type Description
    uid string The ID of the user.
    mute boolean Stop or resume audio playback at the far end. Valid values:
    • true: The playback is stopped.
    • false: The playback is resumed.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • muteAllRemoteAudio: Stop or resume all audio playback at the remote end.
    muteAllRemoteAudio (mute: boolean): number;
    Parameter description
    Parameter Type Description
    mute boolean Stop or resume all audio playback at the far end. Valid values:
    • true: The playback is stopped.
    • false: The playback is resumed.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startAudioCapture: enables audio collection.
    startAudioCapture (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAudioCapture: Disables audio collection.
    stopAudioCapture (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startAudioPlayer: enables the audio playback device.
    startAudioPlayer (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAudioPlayer: Disables audio playback.
    stopAudioPlayer (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableAudioVolumeIndication: Set the volume callback frequency and smoothing factor.
    enableAudioVolumeIndication (interval: number, smooth: number, reportVad: number): number;
    Parameter description
    Parameter Type Description
    interval number The time interval. Unit: milliseconds. The minimum value must not be less than 10ms. We recommend that you set the value to 300 to 500ms. If the value is less than or equal to 0, the volume prompt and speaker prompt functions are not enabled.
    smooth number The smoothing coefficient. The larger the value, the higher the smoothing degree. The lower the value, the better the real-time performance. Valid values:[0,9]. We recommend that you set 3.
    reportVad number Speaker detection switch. Valid values:
    • 0: disables the trace flag.
    • 1: On, call back the status of each speaker through the onAudioVolumeCallback interface.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioProfile: Set Audio Profile.
    setAudioProfile (audioProfile: AliEngineAudioProfile, audioScene: AliEngineAudioScenario): number;
    Parameter description
    Parameter Type Description
    audio_profile AliEngineAudioProfile Audio capture or encoding mode parameters.
    audio_scene AliEngineAudioScenario Audio scene mode parameters.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startAudioAccompany: Start mixing.
    startAudioAccompany (filePath: string, onlyLocalPlay: boolean, replaceMic: boolean, loopCycle: number): number;
    Parameter description
    Parameter Type Description
    filePath string The path of the mixing file.
    onlyLocalPlay boolean Specifies whether to play only locally.
    replaceMic boolean Specifies whether to replace the MIC.
    loopCycles number The number of cycles. You can set this parameter to -1 or a positive integer.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAudioAccompany: Stop mixing.
    stopAudioAccompany (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioAccompanyVolume: Set the mixing volume. It takes effect only after you call the startAudioAccompany.
    setAudioAccompanyVolume (volume: number): number;
    Parameter description
    Parameter Type Description
    volume number The mixing volume. Valid values:[0,100].
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioAccompanyPublishVolume: specifies the volume of stream ingest after mixing. This parameter takes effect only after you call the startAudioAccompany.
    setAudioAccompanyPublishVolume (volume: number): number;
    Parameter description
    Parameter Type Description
    volume number The mixing volume. Valid values:[0,100].
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyPublishVolume: obtains the remix volume of the stream.
    getAudioAccompanyPublishVolume (): number;
    Return result

    Returns the remix volume of the stream.

  • setAudioAccompanyPlayoutVolume: specifies the volume of local playback after mixing. This parameter takes effect only after you call the startAudioAccompany.
    setAudioAccompanyPlayoutVolume (volume: number): number;
    Parameter description
    Parameter Type Description
    volume number The mixing volume. Valid values:[0,100].
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyPlayoutVolume: obtains the local playback volume of the remix.
    getAudioAccompanyPlayoutVolume (): number;
    Return result

    Returns the volume of the local playback of the current mix.

  • pauseAudioAccompany: The mixing is paused.
    pauseAudioAccompany (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • resumeAudioAccompany: Start mixing again.
    resumeAudioAccompany (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyDuration: obtains the duration of the accompaniment file.
    getAudioAccompanyDuration (): number;
    Return result

    The duration of the returned current accompaniment file. Unit: milliseconds.

  • getAudioAccompanyCurrentPosition: Obtains the music file playback progress.
    getAudioAccompanyCurrentPosition (): number;
    Return result

    Returns the playback progress of the current music file. Unit: milliseconds.

  • setAudioAccompanyPosition: specifies the playback position of the audio file.
    setAudioAccompanyPosition (pos: number): number;
    Parameter description
    Parameter Type Description
    pos number The location of the progress bar. Unit: milliseconds.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableSystemAudioRecording: specifies whether to enable system sound collection and push.
    enableSystemAudioRecording (enable: boolean, path: string): number;
    Parameter description
    Parameter Type Description
    enable boolean Specifies whether to enable system sound collection and push. Valid values:
    • true: enables TDE.
    • false: disables the trigger.
    path string Windows needs to be set as a third-party player path; Mac needs to be set as a virtual sound card device name to collect system sound. When it is turned off, you need to specify the name of the speaker to be switched back.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isSystemAudioRecording: whether to enable system sound collection and push.
    isSystemAudioRecording (): boolean;
    Return result

    true indicates that the method call was successful. false indicates that the method call failed.

  • setSystemAudioRecordingVolume: Set the system sound collection push volume.
    setSystemAudioRecordingVolume (volume: number): number;
    Parameter description
    Parameter Type Description
    volume number Set the volume.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getSystemAudioRecordingVolume: Obtain the current settings of the system sound collection push volume.
    getSystemAudioRecordingVolume (): number;
    Note You need to enable system sound collection and push before you can set it. Otherwise, the setting fails.
    Return result

    Returns the system volume.

  • getAudioCaptureList: Obtains a list of recording devices in the system.
    getAudioCaptureList(): AliEngineDeviceInfo[];
    Return result

    Returns a list of recording devices in the system.

  • getCurrentAudioCaptureName: obtains the used recording device name.
    getCurrentAudioCaptureName(): string;
    Return result

    Returns the name of the current audio collection device.

  • getCurrentAudioCaptureID: obtains the ID of the used recording device.
    getCurrentAudioCaptureID (): string;
    Return result

    Returns the ID of the current audio collection device.

  • setCurrentAudioCaptureName: Select a recording device name.
    setCurrentAudioCaptureName(captureName: string): number;
    Parameter description
    Parameter Type Description
    captureName string The audio collection device name.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setCurrentAudioCaptureID: Select the recording device ID.
    setCurrentAudioCaptureID (captureID: string): number;
    Parameter description
    Parameter Type Description
    captureID string The audio collection device name.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioPlayerList: Get the list of speakers in the system.
    getAudioPlayerList (): AliEngineDeviceInfo[];
    Return result

    Returns a list of audio playback devices.

  • getCurrentAudioPlayerName: Gets the name of the speaker currently in use.
    getCurrentAudioPlayerName (): string;
    Return result

    Returns the name of the current audio playback device.

  • getCurrentAudioPlayerID: obtains the ID of the speaker currently in use.
    getCurrentAudioPlayerID (): string;
    Return result

    Returns the ID of the current audio playback device.

  • setCurrentAudioPlayerName: Select the speaker name.
    setCurrentAudioPlayerName (playerName: string): number;
    Parameter description
    Parameter Type Description
    playerName string The audio playback device name.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setCurrentAudioPlayerID: Select the speaker ID.
    setCurrentAudioPlayerID (playerID: string): number;
    Parameter description
    Parameter Type Description
    playerID string The ID of the audio playback device.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startTestAudioRecordByName: Starts testing the audio capture device.
    startTestAudioRecordByName (deviceName: string, callbackInterval: number): number;
    Parameter description
    Parameter Type Description
    deviceName string The audio collection device name.
    callbackInterval number The volume callback frequency. Unit: milliseconds. Default value: 200 milliseconds.
    Note The volume information is returned through the onAudioDeviceRecordLevel callback after the test starts.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startTestAudioRecordById: Turn on the microphone device test (by device ID).
    startTestAudioRecordById (deviceId: string, callbackInterval: number): number;
    Parameter description
    Parameter Type Description
    deviceId string The ID of the device.
    callbackInterval number The volume callback frequency. Unit: milliseconds. Default value: 200 milliseconds.
    Note The volume information is returned through the onAudioDeviceRecordLevel callback after the test starts.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopTestAudioRecord: Stop testing the audio capture device.
    stopTestAudioRecord (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startTestAudioPlayoutByName: starts testing the audio playback device.
    startTestAudioPlayoutByName (deviceName: string, filePath: string, callbackInterval: number, loopCycles: number): number;
    Parameter description
    Parameter Type Description
    deviceName string The audio playback device name.
    filePath string The path of the audio file.
    callbackInterval number The volume callback frequency. Unit: milliseconds. Default value: 200 milliseconds.
    loopCycles number The number of repeated playback times. -1 indicates loop playback.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startTestAudioPlayoutById: Turn on the speaker device test (by device ID).
    startTestAudioPlayoutById (deviceId: string, filePath: string, callbackInterval: number, loopCycles: number): number;
    Parameter description
    Parameter Type Description
    deviceId string The ID of the device.
    filePath string The path of the audio file.
    callbackInterval number The volume callback frequency. Unit: milliseconds. Default value: 200 milliseconds.
    loopCycles number The number of repeated playback times. -1 indicates loop playback.
    Note The volume information is returned through the onAudioDevicePlayoutLevel callback after the test starts.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopTestAudioPlayout: Stop testing the audio playback device.
    stopTestAudioPlayout (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getCameraList: obtains the list of cameras.
    getCameraList (): AliEngineDeviceInfo [];
    Return result

    Return to the list of cameras.

  • getCurrentCameraName: obtains the name of the camera currently in use.
    getCurrentCameraName (): string;
    Return result

    Returns the name of the currently used camera.

  • getCurrentCameraID: obtains the ID of the currently used camera.
    getCurrentCameraID (): string;
    Return result

    Returns the ID of the currently used camera.

  • setCurrentCameraName: Select a camera name.
    setCurrentCameraName (cameraName: string): number;
    Parameter description
    Parameter Type Description
    cameraName string The name of the camera.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setCurrentCameraID: Select the camera ID.
    setCurrentCameraID (cameraID: string): number;
    Parameter description
    Parameter Type Description
    cameraID string The ID of the camera.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startPreview: enables preview.
    startPreview (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopPreview: stops the preview.
    startPreview (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getUserInfo: queries remote user information.
    getUserInfo (uid: string): AliEngineUserInfo;
    Parameter description
    Parameter Type Description
    uid string The ID of the user.
    Return result

    The AliEngineUserInfo of the returned user information.

  • getSDKVersion: obtains the SDK version number.
    getSDKVersion (): string;
    Return result

    The version of the stream ingest SDK for Android is returned.

  • setClientRole: specifies a user role.
    setClientRole (clientRole: AliEngineClientRole): number;
    Parameter description
    Parameter Type Description
    clientRole AliEngineClientRole The type of the user role.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getClientRole: obtains the user role.
    getClientRole (): AliEngineClientRole;
    Return result

    Returns the current user role.

  • startLastmileDetect: starts network quality detection.
    startLastmileDetect (): number;
    Note This interface must be called before the joinChannel. The probe result is called back in the onLastmileDetectResultWithQuality.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopLastmileDetect: stops network quality detection.
    stopLastmileDetect (): number;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getCurrentConnectionStatus: obtains the current network link status.
    getCurrentConnectionStatus (): AliEngineConnectionStatus;
    Return result

    Returns the AliEngineConnectionStatus of the current network connection status.

  • on: subscribes to events.
    on(event: string, handler: function): void;
    Parameter description
    Parameter Type Description
    event string The name of the system event.
    handler function The callback function.
  • off: unsubscribes from the event.
    off(event: string, handler: function): void;
    Parameter description
    Parameter Type Description
    event string The name of the system event.
    handler function The callback function.