NERtc Windows SDK  V4.4.301
Public 成员函数 | 所有成员列表
nertc::IAudioDeviceManager类 参考abstract

#include <nertc_audio_device_manager.h>

Public 成员函数

virtual IDeviceCollectionenumerateRecordDevices ()=0
 
virtual int setRecordDevice (const char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int getRecordDevice (char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual IDeviceCollectionenumeratePlayoutDevices ()=0
 
virtual int setPlayoutDevice (const char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int getPlayoutDevice (char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int setRecordDeviceVolume (uint32_t volume)=0
 
virtual int getRecordDeviceVolume (uint32_t *volume)=0
 
virtual int setPlayoutDeviceVolume (uint32_t volume)=0
 
virtual int getPlayoutDeviceVolume (uint32_t *volume)=0
 
virtual int setPlayoutDeviceMute (bool mute)=0
 
virtual int getPlayoutDeviceMute (bool *mute)=0
 
virtual int setRecordDeviceMute (bool mute)=0
 
virtual int getRecordDeviceMute (bool *mute)=0
 
virtual int adjustRecordingSignalVolume (uint32_t volume)=0
 
virtual int adjustPlaybackSignalVolume (uint32_t volume)=0
 
virtual int startRecordDeviceTest (uint64_t indication_interval)=0
 
virtual int stopRecordDeviceTest ()=0
 
virtual int startPlayoutDeviceTest (const char *test_audio_file_path)=0
 
virtual int stopPlayoutDeviceTest ()=0
 
virtual int startAudioDeviceLoopbackTest (uint64_t indication_interval)=0
 
virtual int stopAudioDeviceLoopbackTest ()=0
 

详细描述

Audio device management method.

IAudioDeviceManager interface class provides related interfaces for audio device management. Gets IAudioDeviceManager interface through instantiating the IAudioDeviceManager class.

成员函数说明

◆ adjustPlaybackSignalVolume()

virtual int nertc::IAudioDeviceManager::adjustPlaybackSignalVolume ( uint32_t  volume)
pure virtual

Adjusts the volume of the audio local playback.

注解
The method only adjusts the volume of captured signals in the application programs without modifying the volumes of the device. If you need to modify the volume of the device, see related interfaces of device management.
参数
[in]volumeindicates the playback volume. Valid range: 0 to 400. Where:
  • 0: Mute.
  • 100: The original volume.
  • 400: The maximum value can be four times the original volume. The limit value is protected.
返回
  • 0: Success.
  • Other values: Failure.

◆ adjustRecordingSignalVolume()

virtual int nertc::IAudioDeviceManager::adjustRecordingSignalVolume ( uint32_t  volume)
pure virtual

Adjusts the volume of captured signals.

注解
The method only adjusts the volume of captured signals in the application programs without modifying the volumes of the device. If you need to modify the volume of the device, see related interfaces of device management.
参数
[in]volumeindicates the volume of the captured recording. Valid values: 0 to 400. Where:
  • 0: Mute.
  • 100: The original volume.
  • 400: The maximum value can be four times the original volume. The limit value is protected.
返回
  • 0: Success.
  • Other values: Failure.

◆ enumeratePlayoutDevices()

virtual IDeviceCollection* nertc::IAudioDeviceManager::enumeratePlayoutDevices ( )
pure virtual

Gets the list of all playback devices in the system.

The method returns an IDeviceCollection object that includes all audio playback devices in the system. Enumerates playback devices with the App through the IDeviceCollection object. After the method is used, the App needs to destroy the returned object by calling the destroy method.

注解
The system must destroy the returned value by calling destroy method.
返回
  • Success: Gets an IDeviceCollection object that includes all audio playback devices.
  • Failure: Null.

◆ enumerateRecordDevices()

virtual IDeviceCollection* nertc::IAudioDeviceManager::enumerateRecordDevices ( )
pure virtual

Gets the list of all the audio capture devices in the system.

The method returns an IDeviceCollection object that includes all the audio capture devices in the system. Enumerates capturing devices with the App through the IDeviceCollection object.

注解
After the method is used, the App needs to destroy the returned object by calling destroy method.
返回
  • Success: An IDeviceCollection object includes all the audio capture devices.
  • Failure: Null.

◆ getPlayoutDevice()

virtual int nertc::IAudioDeviceManager::getPlayoutDevice ( char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Gets the ID of the audio playback device that is currently used.

参数
device_idThe ID of audio playback devices.
返回
  • 0: Success.
  • Other values: Failure.

◆ getPlayoutDeviceMute()

virtual int nertc::IAudioDeviceManager::getPlayoutDeviceMute ( bool *  mute)
pure virtual

Confirms whether the audio playback device is muted.

参数
muteindicates the audio playback device is muted.
  • true: The device is muted.
  • false: The device is unmuted.
返回
  • 0: Success.
  • Other values: Failure.

◆ getPlayoutDeviceVolume()

virtual int nertc::IAudioDeviceManager::getPlayoutDeviceVolume ( uint32_t *  volume)
pure virtual

Gets the volume of audio playback device.

参数
volumeThe volume of audio playback device.
返回
  • 0: Success.
  • Other values: Failure.

◆ getRecordDevice()

virtual int nertc::IAudioDeviceManager::getRecordDevice ( char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Gets the ID of the audio capture device that is currently used.

参数
device_idThe device ID of the audio capture devices.
返回
  • 0: Success.
  • Other values: Failure.

◆ getRecordDeviceMute()

virtual int nertc::IAudioDeviceManager::getRecordDeviceMute ( bool *  mute)
pure virtual

Confirms whether the audio playback device is muted.

参数
muteindicates the audio playback device is muted.
  • true: The device is muted.
  • false: The device is unmuted.
返回
  • 0: Success.
  • Other values: Failure.

◆ getRecordDeviceVolume()

virtual int nertc::IAudioDeviceManager::getRecordDeviceVolume ( uint32_t *  volume)
pure virtual

Gets the volume of the audio capture device.

参数
volumeThe volume of the audio capture device.
返回
  • 0: Success.
  • Other values: Failure.

◆ setPlayoutDevice()

virtual int nertc::IAudioDeviceManager::setPlayoutDevice ( const char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Specifies the audio playback device.

参数
device_idThe device ID of audio playback devices. Gets the ID through enumeratePlayoutDevices. Device swapping or plugging does not affect deviceId.
返回
  • 0: Success.
  • Other values: Failure.

◆ setPlayoutDeviceMute()

virtual int nertc::IAudioDeviceManager::setPlayoutDeviceMute ( bool  mute)
pure virtual

Specifies to mute or unmute the audio playback device.

参数
muteindicates whether to unmute the audio playback device.
  • true: Specifies to mute the audio playback device.
  • false: Specifies to unmute the audio playback device.
返回
  • 0: Success.
  • Other values: Failure.

◆ setPlayoutDeviceVolume()

virtual int nertc::IAudioDeviceManager::setPlayoutDeviceVolume ( uint32_t  volume)
pure virtual

Sets the volume of audio playback device.

参数
volumeThe volume of audio playback device. Valid values: 0 to 255.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRecordDevice()

virtual int nertc::IAudioDeviceManager::setRecordDevice ( const char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Specifies the audio capture device.

参数
device_idThe device ID of the audio capture devices. Gets the ID through enumerateRecordDevices. Device swapping or plugging does not affect deviceId.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRecordDeviceMute()

virtual int nertc::IAudioDeviceManager::setRecordDeviceMute ( bool  mute)
pure virtual

Specifies to mute or unmute the audio playback device.

参数
muteindicates whether to unmute the audio playback device.
  • true: Specifies to mute the audio playback device.
  • false: Specifies to unmute the audio playback device.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRecordDeviceVolume()

virtual int nertc::IAudioDeviceManager::setRecordDeviceVolume ( uint32_t  volume)
pure virtual

Sets the volume of the audio capture device.

参数
volumeThe volume of the audio capture device. Valid values: 0 to 255.
返回
  • 0: Success.
  • Other values: Failure.

◆ startAudioDeviceLoopbackTest()

virtual int nertc::IAudioDeviceManager::startAudioDeviceLoopbackTest ( uint64_t  indication_interval)
pure virtual

Starts the test of the audio device circuit.

The method tests whether the audio capturing and playback device can work properly. Once the test starts, the audio capture device captures local audio, and then plays the local audio. The SDK triggers onLocalAudioVolumeIndication callback at the time interval set in this method, which reports the volume information of the audio.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio device circuit can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
  • You can use the method locally to test the audio device, which does not require an Internet connection.
参数
indication_intervalThe time interval that SDK returns onLocalAudioVolumeIndication callback. Unit: milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ startPlayoutDeviceTest()

virtual int nertc::IAudioDeviceManager::startPlayoutDeviceTest ( const char *  test_audio_file_path)
pure virtual

Starts the test of the audio capture device.

The method tests whether the audio capture device can work properly. After the test is started, SDK plays the specified audio files. If the sound is successfully played, the playback device can work properly.

After calling the method, the SDK triggers onLocalAudioVolumeIndication callback per 100 ms, which reports the volume information of the playback device.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio playback device can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
  • Supported file formats: wav, mp3, aac.
参数
test_audio_file_pathThe absolute path of audio files. The path string is encoded in UTF-8.
返回
  • 0: Success. You can hear the audio of the set files.
  • Other values: Failure.

◆ startRecordDeviceTest()

virtual int nertc::IAudioDeviceManager::startRecordDeviceTest ( uint64_t  indication_interval)
pure virtual

Starts the test of the audio capture device.

The method tests whether the audio capture device can work properly.

After calling the method, the SDK triggers onLocalAudioVolumeIndication callback at the time interval set in this method, which reports the volume information of the capturing device.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio capture device can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
参数
indication_intervalindicates the time interval that SDK returns onLocalAudioVolumeIndication callback. Unit: milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopAudioDeviceLoopbackTest()

virtual int nertc::IAudioDeviceManager::stopAudioDeviceLoopbackTest ( )
pure virtual

Stops the test of the audio device circuit.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio device circuit can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopPlayoutDeviceTest()

virtual int nertc::IAudioDeviceManager::stopPlayoutDeviceTest ( )
pure virtual

Stops the test of the audio capture device.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio playback device can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopRecordDeviceTest()

virtual int nertc::IAudioDeviceManager::stopRecordDeviceTest ( )
pure virtual

Stops the test of the audio capture device.

Uses the method to stop the test of the audio capture device.

注解
  • Calls the method before a user needs to join a room.
  • The test of the audio capture device can automatically stop after a call starts. You can also manually stop the test by calling stopRecordDeviceTest.
返回
  • 0: Success.
  • Other values: Failure.

该类的文档由以下文件生成: