Windows

更新时间:
复制 MD 格式

The RTC software development kit (SDK) provides features to detect and manage devices. Before you join a channel, verify that your hardware devices are working correctly. This topic describes the methods for device detection and management.

Overview

RTC SDK allows you to call internal methods to detect and manage devices. For example, you can query the information about devices, detect whether the camera works as expected, detect whether the audio device can record and play audio files, switch between front and rear cameras, or change audio devices (microphone and speaker).

Methods

The following are common methods for device detection and management. For more information, see AliEngine.

  • GetCameraList: Retrieves the list of cameras.
    AliEngineDeviceInfoList* GetCameraList();
    Return value

    Go back to the camera list.

  • GetCurrentCameraName: Retrieves the name of the current camera.
    String GetCurrentCameraName();
    Return value

    The name of the current camera.

  • SetCurrentCameraName: Selects a camera.
    int SetCurrentCameraName(const char* cameraName);
    Parameters
    NameTypeDescription
    cameraNameconst char*The name of the camera.
    Return value

    A value of 0 indicates that the method call is successful. Other values indicate that the method call failed.

  • IsCameraOn: Checks whether the camera is on.
    bool IsCameraOn();
    Return value

    true indicates that the camera is on. false indicates that the camera is off.

  • GetAudioCaptureList: Retrieves the list of audio capture devices.
    AliEngineDeviceInfoList* GetAudioCaptureList();
    Return value

    The list of audio capture devices.

  • GetCurrentAudioCaptureName: Retrieves the name of the current audio capture device.
    String GetCurrentAudioCaptureName();
    Return value

    The name of the current audio capture device.

  • SetCurrentAudioCaptureName: Selects an audio capture device.
    int SetCurrentAudioCaptureName(const char* captureName);
    Parameters
    NameTypeDescription
    captureNameconst char*The name of the audio capture device.
    Return value

    A value of 0 indicates that the method call is successful. Other values indicate that the method call failed.

  • GetAudioPlayerList: Retrieves the list of audio playback devices.
    AliEngineDeviceInfoList* GetAudioPlayerList();
    Return value

    The list of audio playback devices.

  • GetCurrentAudioPlayerName: Retrieves the name of the current audio playback device.
    String GetCurrentAudioPlayerName();
    Return value

    The name of the current audio playback device.

  • SetCurrentAudioPlayerName: Selects an audio playback device.
    int SetCurrentAudioPlayerName(const char* playerName);
    Parameters
    NameTypeDescription
    playerNameconst char*The name of the audio playback device.
    Return value

    A value of 0 indicates that the method call is successful. Other values indicate that the method call failed.