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
| Method | Description | Supported earliest version |
| GetAudioCaptureList | Queries recording devices in a channel. | V2.1 |
| GetCurrentAudioCaptureName | Queries the name of the recording device that is in use. | V2.1 |
| GetCurrentAudioCaptureID | Queries the ID of the recording device that is in use. | V2.1 |
| SetCurrentAudioCaptureName | Specifies the name of a recording device. | V2.1 |
| SetCurrentAudioCaptureID | Specifies the ID of a recording device. | V2.1 |
| GetAudioPlayerList | Queries speakers in a channel. | V2.1 |
| GetCurrentAudioPlayerName | Queries the name of the speaker that is in use. | V2.1 |
| GetCurrentAudioPlayerID | Queries the ID of the speaker that is in use. | V2.1 |
| SetCurrentAudioPlayerName | Specifies the name of a speaker. | V2.1 |
| SetCurrentAudioPlayerID | Specifies the ID of a speaker. | V2.1 |
| SetRecordingDeviceVolume | Sets the volume of an audio collection device. | V2.1 |
| GetRecordingDeviceVolume | Queries the volume of an audio collection device. | V2.1 |
| SetPlaybackDeviceVolume | Sets the volume of an audio playback device. | V2.1 |
| GetPlaybackDeviceVolume | Queries the volume of an audio playback device. | V2.1 |
| StartTestAudioRecordByName | Tests an audio collection device. | V2.1 |
| StartTestAudioRecordById | Tests a microphone. The microphone to be tested is specified by the microphone ID. | V2.1 |
| StopTestAudioRecord | Stops testing an audio collection device. | V2.1 |
| StartTestAudioPlayoutByName | Tests an audio playback device. | V2.1 |
| StartTestAudioPlayoutById | Tests a speaker. The speaker to be tested is specified by the speaker ID. | V2.1 |
| StopTestAudioPlayout | Stops testing an audio playback device. | V2.1 |
Details of methods
- GetAudioCaptureList: queries recording devices in a channel.
Return value descriptionAliEngineDeviceInfoList* GetAudioCaptureList();Returns a list of recording devices.
- GetCurrentAudioCaptureName: queries the name of the recording device that is in use.
Return value descriptionString GetCurrentAudioCaptureName();Returns the name of the recording device that is in use.
- GetCurrentAudioCaptureID: queries the ID of the recording device that is in use.
Return value descriptionString GetCurrentAudioCaptureID();Returns the ID of the recording device that is in use.
- SetCurrentAudioCaptureName: specifies the name of a recording device.
Parametersint SetCurrentAudioCaptureName(const char* captureName);
Return value descriptionParameter Type Description captureName const char* The name of the recording device. If 0 is returned, the call is successful. Otherwise, the call fails.
- SetCurrentAudioCaptureID: specifies the ID of a recording device.
Parametersint SetCurrentAudioCaptureID(const char* captureID);
Return value descriptionParameter Type Description captureID const char* The ID of the recording device. If 0 is returned, the call is successful. Otherwise, the call fails.
- GetAudioPlayerList: queries speakers in a channel.
Return value descriptionAliEngineDeviceInfoList* GetAudioPlayerList();Returns a list of speakers.
- GetCurrentAudioPlayerName: queries the name of the speaker that is in use.
Return value descriptionString GetCurrentAudioPlayerName();Returns the name of the speaker that is in use.
- GetCurrentAudioPlayerID: queries the ID of the speaker that is in use.
Return value descriptionString GetCurrentAudioPlayerID();Returns the ID of the speaker that is in use.
- SetCurrentAudioPlayerName: specifies the name of a speaker.
Parametersint SetCurrentAudioPlayerName(const char* playerName);
Return value descriptionParameter Type Description playerName const char* The name of the speaker. If 0 is returned, the call is successful. Otherwise, the call fails.
- SetCurrentAudioPlayerID: specifies the ID of a speaker.
Parametersint SetCurrentAudioPlayerID(const char* playerID);
Return value descriptionParameter Type Description playerID const char* The ID of the speaker. If 0 is returned, the call is successful. Otherwise, the call fails.
- SetRecordingDeviceVolume: sets the volume of an audio collection device.
Parametersint SetRecordingDeviceVolume(int volume);
Return value descriptionParameter Type Description volume int The volume of the audio collection device. Valid values: 0 to 100. The default value indicates the current volume of the microphone. If 0 is returned, the call is successful. Otherwise, the call fails.
- GetRecordingDeviceVolume: queries the volume of an audio collection device.
Return value descriptionint GetRecordingDeviceVolume();Returns the volume of the audio collection device.
- SetPlaybackDeviceVolume: sets the volume of an audio playback device.
Parametersint SetPlaybackDeviceVolume(int volume);
Return value descriptionParameter Type Description volume int The volume of the audio playback device. Valid values: 0 to 100. The default value indicates the current volume of the speaker. If 0 is returned, the call is successful. Otherwise, the call fails.
- GetPlaybackDeviceVolume: queries the volume of an audio playback device.
Return value descriptionint GetPlaybackDeviceVolume();Returns the volume of the audio playback device.
- StartTestAudioRecordByName: tests an audio collection device.
Parametersint StartTestAudioRecordByName(const char *deviceName, int callbackInterval = 0);
Return value descriptionParameter Type Description deviceName const char * The name of the audio collection device. callbackInterval int The interval between two consecutive callbacks. Unit: milliseconds. Default value: 200. 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.
Parametersint StartTestAudioRecordById(const char * deviceId, int callbackInterval = 0);
Return value descriptionParameter Type Description deviceId const char * The ID of the microphone. callbackInterval int The interval between two consecutive callbacks. Unit: milliseconds. Default value: 200. 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.
Return value descriptionint StopTestAudioRecord();If 0 is returned, the call is successful. Otherwise, the call fails.
- StartTestAudioPlayoutByName: tests an audio playback device.
Parametersint StartTestAudioPlayoutByName(const char* deviceName, const char* filePath, int callbackInterval = 0, int loopCycles = 0);
Return value descriptionParameter Type Description deviceName const char* The name of the audio playback device. filePath const char* The path of the audio file. callbackInterval int The interval between two consecutive callbacks. Unit: milliseconds. Default value: 200. loopCycles int The number of times the audio file is repeatedly played. A value of -1 indicates loop playback. 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.
Parametersint StartTestAudioPlayoutById(const char* deviceId, const char* filePath, int callbackInterval = 0, int loopCycles = 0);
Return value descriptionParameter Type Description deviceId const char* The ID of the speaker. filePath const char* The path of the audio file. callbackInterval int The interval between two consecutive callbacks. Unit: milliseconds. Default value: 200. loopCycles int The number of times the audio file is repeatedly played. A value of -1 indicates loop playback. 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.
Return value descriptionint StopTestAudioPlayout();If 0 is returned, the call is successful. Otherwise, the call fails.