IAliEngineAudioDeviceManager class

更新时间:
复制 MD 格式

This topic describes the methods of the IAliEngineAudioDeviceManager class provided by Real-Time Communication (RTC) SDK for Windows.

SDK reference

For more information about the IAliEngineAudioDeviceManager class, see AliRTCSdk::IAliEngineAudioDeviceManager.

List of methods

Methods for audio device management

MethodDescriptionSupported earliest version
GetAudioCaptureListQueries recording devices in a channel. V2.1
GetCurrentAudioCaptureNameQueries the name of the recording device that is in use. V2.1
GetCurrentAudioCaptureIDQueries the ID of the recording device that is in use. V2.1
SetCurrentAudioCaptureNameSpecifies the name of a recording device. V2.1
SetCurrentAudioCaptureIDSpecifies the ID of a recording device. V2.1
GetAudioPlayerListQueries speakers in a channel. V2.1
GetCurrentAudioPlayerNameQueries the name of the speaker that is in use. V2.1
GetCurrentAudioPlayerIDQueries the ID of the speaker that is in use. V2.1
SetCurrentAudioPlayerNameSpecifies the name of a speaker. V2.1
SetCurrentAudioPlayerIDSpecifies the ID of a speaker. V2.1
SetRecordingDeviceVolumeSets the volume of an audio collection device. V2.1
GetRecordingDeviceVolumeQueries the volume of an audio collection device. V2.1
SetPlaybackDeviceVolumeSets the volume of an audio playback device. V2.1
GetPlaybackDeviceVolumeQueries the volume of an audio playback device. V2.1
StartTestAudioRecordByNameTests an audio collection device. V2.1
StartTestAudioRecordByIdTests a microphone. The microphone to be tested is specified by the microphone ID. V2.1
StopTestAudioRecordStops testing an audio collection device. V2.1
StartTestAudioPlayoutByNameTests an audio playback device. V2.1
StartTestAudioPlayoutByIdTests a speaker. The speaker to be tested is specified by the speaker ID. V2.1
StopTestAudioPlayoutStops testing an audio playback device. V2.1

Details of methods

  • GetAudioCaptureList: queries recording devices in a channel.
    AliEngineDeviceInfoList* GetAudioCaptureList();
    Return value description

    Returns a list of recording devices.

  • GetCurrentAudioCaptureName: queries the name of the recording device that is in use.
    String GetCurrentAudioCaptureName();
    Return value description

    Returns the name of the recording device that is in use.

  • GetCurrentAudioCaptureID: queries the ID of the recording device that is in use.
    String GetCurrentAudioCaptureID();
    Return value description

    Returns the ID of the recording device that is in use.

  • SetCurrentAudioCaptureName: specifies the name of a recording device.
    int SetCurrentAudioCaptureName(const char* captureName);
    Parameters
    ParameterTypeDescription
    captureNameconst char*The name of the recording device.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • SetCurrentAudioCaptureID: specifies the ID of a recording device.
    int SetCurrentAudioCaptureID(const char* captureID);
    Parameters
    ParameterTypeDescription
    captureIDconst char*The ID of the recording device.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • GetAudioPlayerList: queries speakers in a channel.
    AliEngineDeviceInfoList* GetAudioPlayerList();
    Return value description

    Returns a list of speakers.

  • GetCurrentAudioPlayerName: queries the name of the speaker that is in use.
    String GetCurrentAudioPlayerName();
    Return value description

    Returns the name of the speaker that is in use.

  • GetCurrentAudioPlayerID: queries the ID of the speaker that is in use.
    String GetCurrentAudioPlayerID();
    Return value description

    Returns the ID of the speaker that is in use.

  • SetCurrentAudioPlayerName: specifies the name of a speaker.
    int SetCurrentAudioPlayerName(const char* playerName);
    Parameters
    ParameterTypeDescription
    playerNameconst char*The name of the speaker.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • SetCurrentAudioPlayerID: specifies the ID of a speaker.
    int SetCurrentAudioPlayerID(const char* playerID);
    Parameters
    ParameterTypeDescription
    playerIDconst char*The ID of the speaker.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • SetRecordingDeviceVolume: sets the volume of an audio collection device.
    int SetRecordingDeviceVolume(int volume);
    Parameters
    ParameterTypeDescription
    volumeintThe volume of the audio collection device. Valid values: 0 to 100. The default value indicates the current volume of the microphone.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • GetRecordingDeviceVolume: queries the volume of an audio collection device.
    int GetRecordingDeviceVolume();
    Return value description

    Returns the volume of the audio collection device.

  • SetPlaybackDeviceVolume: sets the volume of an audio playback device.
    int SetPlaybackDeviceVolume(int volume);
    Parameters
    ParameterTypeDescription
    volumeintThe volume of the audio playback device. Valid values: 0 to 100. The default value indicates the current volume of the speaker.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • GetPlaybackDeviceVolume: queries the volume of an audio playback device.
    int GetPlaybackDeviceVolume();
    Return value description

    Returns the volume of the audio playback device.

  • StartTestAudioRecordByName: tests an audio collection device.
    int StartTestAudioRecordByName(const char *deviceName, int callbackInterval = 0);
    Parameters
    ParameterTypeDescription
    deviceNameconst char *The name of the audio collection device.
    callbackIntervalintThe interval between two consecutive callbacks. Unit: milliseconds. Default value: 200.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

    Note The volume information is returned by the onAudioDeviceRecordLevel callback.
  • StartTestAudioRecordById: tests a microphone. The microphone to be tested is specified by the microphone ID.
    int StartTestAudioRecordById(const char * deviceId, int callbackInterval = 0);
    Parameters
    ParameterTypeDescription
    deviceIdconst char *The ID of the microphone.
    callbackIntervalintThe interval between two consecutive callbacks. Unit: milliseconds. Default value: 200.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

    Note The volume information is returned by the onAudioDeviceRecordLevel callback.
  • StopTestAudioRecord: stops testing an audio collection device.
    int StopTestAudioRecord();
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • StartTestAudioPlayoutByName: tests an audio playback device.
    int StartTestAudioPlayoutByName(const char* deviceName, const char* filePath, int callbackInterval = 0, int loopCycles = 0);
    Parameters
    ParameterTypeDescription
    deviceNameconst char*The name of the audio playback device.
    filePathconst char*The path of the audio file.
    callbackIntervalintThe interval between two consecutive callbacks. Unit: milliseconds. Default value: 200.
    loopCyclesintThe number of times the audio file is repeatedly played. A value of -1 indicates loop playback.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

  • StartTestAudioPlayoutById: tests a speaker. The speaker to be tested is specified by the speaker ID.
    int StartTestAudioPlayoutById(const char* deviceId, const char* filePath, int callbackInterval = 0, int loopCycles = 0);
    Parameters
    ParameterTypeDescription
    deviceIdconst char*The ID of the speaker.
    filePathconst char*The path of the audio file.
    callbackIntervalintThe interval between two consecutive callbacks. Unit: milliseconds. Default value: 200.
    loopCyclesintThe number of times the audio file is repeatedly played. A value of -1 indicates loop playback.
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.

    Note The volume information is returned by the onAudioDevicePlayoutLevel callback.
  • StopTestAudioPlayout: stops testing an audio playback device.
    int StopTestAudioPlayout();
    Return value description

    If 0 is returned, the call is successful. Otherwise, the call fails.